Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Monday, August 25, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Locking an Opportunity
Brian Thews
Posts: 34
 
Locking an OpportunityYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Phil Parkin
Posts: 819
Top 10 forum poster: 819 posts
 
Re: Locking an OpportunityYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 02 Sep 08 6:33 PM
Check out this link for a cool solution:

http://www.slxdeveloper.com/page.aspx?action=viewarticle&articleid=70

Phil
[Reply][Quote]
Brian Thews
Posts: 34
 
Re: Locking an OpportunityYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 03 Sep 08 10:45 AM
perfect, thanks!
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Locking an OpportunityYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Re: Locking an OpportunityYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/25/2025 10:10:07 AM