Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Saturday, February 22, 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: How to prevent deletion of specific activities
Stefan Held
Posts: 18
 
How to prevent deletion of specific activitiesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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
[Reply][Quote]
Kris Halsrud
Posts: 88
 
Re: How to prevent deletion of specific activitiesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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)
[Reply][Quote]
Stefan Held
Posts: 18
 
Re: How to prevent deletion of specific activitiesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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!
[Reply][Quote]
Malay Mukherjee
Posts: 7
 
Re: How to prevent deletion of specific activitiesYour last visit to this thread was on 1/1/1970 12:00:00 AM
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


 

[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): 2/22/2025 3:45:14 PM