By Changing the Sub routine, can I restrict users from Deleting a certain category of Activity??

Question:

I would like to keep the users from deleting activities of a certain category.
I changed the respective sub in Global Activity: Is this correct?

Sub Application_BeforeDeleteActivity(Activity, ByRef Cancel)

if activity.Category = “RTG” then Cancel = true else Cancel = false
End Sub

 

Answer:

Typically this needs to be a function not a sub. 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.. Change your code to this (no guarantees)

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)

Submit a Comment

Your email address will not be published. Required fields are marked *

Subscribe To Our Newsletter

Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!

You have Successfully Subscribed!