Trigger script - Project owner changed
Hi,
I'm testing out how to notificate a project owner once a project has been assigned to them. This can be notified with an appointment task of 1 minute.
However, I need help with the trigger script. Has anyone else set up a similar script?
I don't have too much experience with CRMscript, but would love to see some examples that I could work out further.
Thanks in advance!
Alle Antworten (1)
A trigger script is run when a particular screen is shown - in other words, it's tied to the user-interface.
Triggers are not run when an API call changes the project, but webhooks are.
The scripts would be similar - but triggers are set up using the admin UI, while webhook scripts need to be registered via the API - there is no UI for webhooks.
You can use trigger script to create the appointment:
CRMScript_Event_Trigger_SalesAfterSaveProject
Use the EventData to see if the project associate_id has changed, and if so, create a new appointment in the new owner's diary.
You can set the new appointment assignedBy and AssignmentStatus to make the appointment appear as a notification for the new owner.