2/22/2025 3:01:28 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.
|
|
|
|
How to prevent deletion of specific activities
Posted: 08 Jun 09 5:38 AM
|
Hi there, I would like to keep the users from deleting activities of a certain category. What I tried is changing the respective sub in Global Activity:
Sub Application_BeforeDeleteActivity(Activity, ByRef Cancel)
if activity.Category = "TLS" then Cancel = true else Cancel = false End Sub
But.... nothing happens. I can, however, see that the script is being executed by placing a msgbox in there. The activity is being deleted anyway, even if the category is TLS
What am I doing wrong?
Thanks in advance.......
Stefan
|
|
|
|
Re: How to prevent deletion of specific activities
Posted: 09 Jun 09 8:44 AM
|
Not sure but typically this needs to be a function not a sub. If you look in the Global System there is a sample "OnBeforeFunctionExecute_EditDeleteItem" that does something similar for campaigns.
Basically with these functions you set the function to be True or False.. Maybe you could try chnage your code to this (not sure if this would work, but worth a shot)
Function Application_BeforeDeleteActivity(Activity, ByRef Cancel)
if activity.Category = "TLS" then Application_BeforeDeleteActivity= true else Application_BeforeDeleteActivity= false End Function
(Where a return of false prevents the deletion)
|
|
|
|
Re: How to prevent deletion of specific activities
Posted: 10 Jun 09 1:09 AM
|
That's exactly what I would have expected.... especially since all other Global Scripts use functions instead of subs. So I thought there must be a reason for this....but I'll try.
thanks! |
|
|
|
Re: How to prevent deletion of specific activities
Posted: 18 Feb 13 8:25 AM
|
fiogf49gjkf0d Hi Stefan,
Did you tried the solution provided by Kris? Had that worked for you?
If yes, can you share me the code snippet for that.
Thanks in Advance
Malay Mukherjee
|
|
|
|
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!
|
|
|
|
|
|
|
|