8/25/2025 8:30:38 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Locking an Opportunity
Posted: 02 Sep 08 10:10 AM
|
I am hoping that there is a "simple" way to not allow users to edit an opportunity once the opportunity is closed. Is there a way to "disable" the save button or something similar if the opportunity has a certain flag on it, such as a closed status? I am on 7.0.1
thanks for any suggestions! brian |
|
|
| |
| |
|
Re: Locking an Opportunity
Posted: 04 Sep 08 9:43 AM
|
Careful, this approach is slick but does NOT lock down a form completely. LookupEdit Buttons, Picklist Buttons, as mentioned in a response Grids, popupmenu buttons, etc.
Just because an item is Readonly=True doesn't mean that item is locked down.
Here's an easily modifiable script that does the basic same thing as Ryan's Class based script.
Sub GeneralForms_Security(TheFormPermission) ''''This is usually a GLOBAL variable. DIM DefaultReadOnlyColor DefaultReadOnlyColor = wclLightGray
If TheFormPermission = "RW" OR TRIM(application.basicfunctions.CurrentUserID) = "ADMIN" then g_UserPermission = "RW" KONTROL = FALSE KONTROL_OPP = TRUE TheControlColor = Application.BasicFunctions.StringToColor("Window") ELSE KONTROL = TRUE KONTROL_OPP = FALSE TheControlColor = DefaultReadOnlyColor END IF
For iControl = 0 To ControlCount - 1 Select Case (TypeName(Controls(iControl))) Case "Edit","Memo" Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
Case "PickList", "NameEdit" Controls(iControl).ButtonVisible = KONTROL_OPP Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
Case "CheckBox" '''',"DataGrid" Controls(iControl).Enabled = KONTROL_OPP
Case "ComboBox" Controls(iControl).Enabled = KONTROL_OPP Controls(iControl).Color = TheControlColor
Case "LookupEdit","DateTimeEdit" Controls(iControl).ReadOnly = KONTROL Controls(iControl).ButtonVisible = KONTROL_OPP Controls(iControl).Color = TheControlColor
Case "PopupEdit" Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
CASE "LinkEdit" Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
Case "Button" ' Do Nothing
Case "DataGrid" ' Do Nothing Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor Controls(iControl).EditOptions.SHOWADD = KONTROL_OPP Controls(iControl).EditOptions.SHOWEDIT = KONTROL_OPP Controls(iControl).EditOptions.SHOWDELETE = KONTROL_OPP
Case "Label" ' Do Nothing
Case "Panel" ' Do Nothing
Case "RadioGroup" ' Do Nothing
Case Else ' Do Nothing End Select Next Call ErrorCheckSLX("SetFormSecurity Failed",0,"ASI Form Level Security") End Sub
|
|
|
|
Re: Locking an Opportunity
Posted: 04 Sep 08 9:44 AM
|
Careful, this approach is slick but does NOT lock down a form completely. LookupEdit Buttons, Picklist Buttons, as mentioned in a response Grids, popupmenu buttons, etc.
Just because an item is Readonly=True doesn't mean that item is locked down.
Here's an easily modifiable script that does the basic same thing as Ryan's Class based script.
Sub GeneralForms_Security(TheFormPermission) ''''This is usually a GLOBAL variable. DIM DefaultReadOnlyColor DefaultReadOnlyColor = wclLightGray
If TheFormPermission = "RW" OR TRIM(application.basicfunctions.CurrentUserID) = "ADMIN" then g_UserPermission = "RW" KONTROL = FALSE KONTROL_OPP = TRUE TheControlColor = Application.BasicFunctions.StringToColor("Window") ELSE KONTROL = TRUE KONTROL_OPP = FALSE TheControlColor = DefaultReadOnlyColor END IF
For iControl = 0 To ControlCount - 1 Select Case (TypeName(Controls(iControl))) Case "Edit","Memo" Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
Case "PickList", "NameEdit" Controls(iControl).ButtonVisible = KONTROL_OPP Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
Case "CheckBox" ,"DataGrid" Controls(iControl).Enabled = KONTROL_OPP
Case "ComboBox" Controls(iControl).Enabled = KONTROL_OPP Controls(iControl).Color = TheControlColor
Case "LookupEdit","DateTimeEdit" Controls(iControl).ReadOnly = KONTROL Controls(iControl).ButtonVisible = KONTROL_OPP Controls(iControl).Color = TheControlColor
Case "PopupEdit" Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
CASE "LinkEdit" Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor
Case "Button" ' Do Nothing
Case "DataGrid" ' Do Nothing Controls(iControl).ReadOnly = KONTROL Controls(iControl).Color = TheControlColor Controls(iControl).EditOptions.SHOWADD = KONTROL_OPP Controls(iControl).EditOptions.SHOWEDIT = KONTROL_OPP Controls(iControl).EditOptions.SHOWDELETE = KONTROL_OPP
Case "Label" ' Do Nothing
Case "Panel" ' Do Nothing
Case "RadioGroup" ' Do Nothing
Case Else ' Do Nothing End Select Next Call ErrorCheckSLX("SetFormSecurity Failed",0,"ASI Form Level Security") End Sub
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|