How it works...

The Creating server actions recipe provides a detailed explanation on how to create a server action in general. For this particular type of action, we need to pick the Execute Python Code option and then write the code to run the text area.

The code can have multiple lines, as is the case in our recipe, and it runs in a context that has available references to objects such as the current record object or the session user. The references available are described in the Creating server actions recipe.

The used code computes the number of days from the current date until the deadline date and uses that to prepare an appropriate notification message. The last line does the actual posting of the message in the task's message wall. The subtype='mt_comment' argument is needed for email notifications to be sent to the followers, just like when we use the New Message button. If no subtype is given, mt_note is used as a default, posting an internal note without notification, as if we used the Log an internal note button.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.22.27.45