Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, June 20, 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: Restricting Account/Opportunity Delete
Rekha
Posts: 72
 
Restricting Account/Opportunity Delete Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Steve Robertson
Posts: 146
 
Re: Restricting Account/Opportunity Delete Your last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Rekha
Posts: 72
 
Re: Restricting Account/Opportunity Delete Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 07 4:41 AM
Hi Steve,

Thank you so much for your help... It works like charm...

Regards,
Rekha
[Reply][Quote]
Steve Robertson
Posts: 146
 
Re: Restricting Account/Opportunity Delete Your last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 18 Sep 07 6:17 AM
Hi Rekha,

Glad to help!

Cheers,

Steve
[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): 6/20/2025 2:48:59 PM