Writing custom code to generate an alert when a workflow reaches a certain stage

243 views
Skip to first unread message

Ed Dikotope

unread,
Jun 15, 2013, 8:52:44 AM6/15/13
to erpnext-dev...@googlegroups.com
Hi,

I need help to achieve the following after setting up a workflow:
+ Send out an alert (email or sms) when a workflow reaches a certain stage

Example workflow:
+ Open support ticket > Contact Customer > Resolve Ticket > Close

When the flow reaches the "Resolve Ticket" stage an email must be sent to "Support Team" and "Customer".

I need steps as I am 100% new to ERPNext and have only managed to create a workflow and stages.

What I read on the web and forum is about custom code both client and server side on the module and doctype
level, I just have no idea what to do with that information because non of it is A B C clear. Please understand that
our experience levels are not the same and I don't mind being teased :P

Rushabh Mehta

unread,
Jun 17, 2013, 1:17:30 AM6/17/13
to erpnext-dev...@googlegroups.com
Ed,

Welcome to the forum. :)

Easiest way to do this is to add a Custom Script (server) to Support Ticket.

And send the mails using on_update method.

Note Custom Scripts (server) are appended to the main script (support_ticket.py) and are a bit hacky and all the functions must start with a left tab as they are a part of a subclass).

This is how Custom Server Scripts are executed:


best,
Rushabh

T: @rushabh_mehta

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ab24a85c-9854-467e-b2e6-dc1bfcc1a21f%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages