3/15/2026 7:22:37 PM
|
| |
| 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.
|
|
|
|
Restricting Account/Opportunity Delete
Posted: 17 Sep 07 3:31 AM
|
Hi, I have a requirement to restrict deleting legacy records. If it is not legacy (Created from SLX) then I can let the user delete. I wrote an intermediate script.
option explicit sub Main If Application.GlobalInfo("gstrLegacyOpportunity") = "Legacy" Then Application.BasicFunctions.DoInvoke "Function", "Edit:DeleteItem" Else Msgbox "Opportunity cannot be deleted!" End If end sub
Problem is, when I call this script in menu --> The Account or Opportunity keyword is getting hidden. I can't figure out why the caption is behaving so. Can anyone please help to solve this issue?
Thanks in advance, Rekha |
|
|
|
Re: Restricting Account/Opportunity Delete
Posted: 18 Sep 07 4:21 AM
|
Hi Rekha,
You could use a global script to do this and bypass the keyword issue:
From your script you are allowing deletes if it is Legacy but in the requirement you say if it is not legacy. I have coded to allow delete if it is legacy, this code is untested too...
Function OnBeforeFunctionExecute_EditDeleteItem (functionNumber,functionName) ' Run prior to any function execution. ' Return True to indicate function handled the event and to stop execution from continuing. Dim strView strView = Application.MainViews.ActiveView.EntityNameSingular Select Case strView Case "Account" If Application.GlobalInfo("gstrLegacyAccount") = "Legacy" Then OnBeforeFunctionExecute_EditDeleteItem = False Else OnBeforeFunctionExecute_EditDeleteItem = True msgbox strView & " cannot be deleted!" End If Case "Opportunity" If Application.GlobalInfo("gstrLegacyOpportunity") = "Legacy" Then OnBeforeFunctionExecute_EditDeleteItem = False Else OnBeforeFunctionExecute_EditDeleteItem = True msgbox strView & " cannot be deleted!" End If End Select End Function
Kind regards,
Steve |
|
|
| |
| |
|
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!
|
|
|
|
|
|
|
|