on 2020 Nov 02 6:36 PM
Hello
Can we send an email to an employee when an employee is added to the sales team in opportunity?
Didn't find how to specify this condition in workflow.
Thank you.
Request clarification before answering.
Hello,
There is no standard Out-of-the-box feature for this functionality but with a little bit of PDI logic this can be done in the following way:
1. Create an extension field 'ZEMAIL_EXT' in Opportunity BO at the root level to say if an email has to be triggered or not. This will be used for evaluating the workflow conditions.
2. Write down logic in Party-BeforeSave or Party-AfterModify event and evaluate if the party node has been modified or not (Using GetFromDB() in comparison with buffered instance). If modified then mark field from step 1 (i.e. ZEMAIL_EXT)as TRUE else FALSE.
3. Create another field ZPARTY_EMAIL for the opportunity Party node which will say if email for this party has been triggered or not.
4. Create a new enhancement implementation for ExitForGettingWorkflowRecipient which will identify all the relevant parties for which mail will be triggered. More details can be found HERE. Also with in this BADI you will mark the value the value of ZPARTY_EMAIL to TRUE or FALSE.
5. Finally create a new workflow rule with condition as ZEMAIL_EXT as TRUE. Mark the BADI implementation name under "Custom Recipient Determination" for email sending parties.
Ideally this should work but pls feel free to revert in case you have any issue.
BR
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.