Jump to content

Smart Event :{!PODOCUMENT.STATE!} == 'Declined'


 Share

Recommended Posts

I create a Smart Event to email user when Purchase Request is rejected

Here is my condition:

{!PODOCUMENT.STATE!} == 'Declined'

 

But for some reasons its not working. Ive tried with the following condition : {!PODOCUMENT.STATE!} == 'Submitted', and it's working

 

Does someone know why I don't receive the emails?

Link to comment
Share on other sites

Try putting the condition into the body of the email and set the actual condition to 1 == 1 (or leave it blank) so that it is guaranteed to fire. This way you can validate that Declined is the right value. You might also want to try double quotes, though I'm not sure it matters but it's how I've always written Smart Event and Smart Rule conditions.

But as I'm thinking about this more, I don't know that you can trigger a Smart Event off of a Decline directly because (I think) there may not be a direct update to the PODOCUMENT record, aka the "set" never happens in this scenario. Instead, a PODOCUMENTAPPROVAL (Purchasing approval history) record gets created and what you see in the UI is simply a lookup to that record. When a user Submits it for approval, however, there is a DB commit (save + submit in reality I believe) which may be why it works for 'Submitted.'  This is all just a guess but I know I've run into issues before working with approvals and smart events.

Lastly, I think this might have been part of the discussion during the recent Partner Office Hours on Platform Triggers (which touched on Smart Events as well). If you search "20240918 - Platform Triggers POH" in the community you should find the slides & recording link*.

*I'll try pasting it here in a follow-up comment but have had issues with links here before.

Link to comment
Share on other sites

 Share

×
×
  • Create New...