Inbound email action: Prevent record from being created in script

Dean C
Tera Contributor

Hello,

We have a scenario where inbound emails with a certain set of conditions are to be created as incident tickets. However, there is a bit of a caveat where if another set of conditions cannot be met, then there should be no incident ticket created at all.

I cannot just add the second set of conditions into the inbound email's conditions because all other inbound email actions will end up running and creating a different type of incident ticket. This will need to be done in the script, but the incident ticket will always be created, even though I am not using the current.insert or current.update commands.

Please assist, and thanks!!

1 ACCEPTED SOLUTION

Michael Jones -
Giga Sage

In your inbound action script, once your conditions are met you can call:

current.setAbortAction(true);

This will prevent the current record from being inserted at the end of the action. 

I hope this helps!

If this was helpful or correct, please be kind and remember to click appropriately!

Michael Jones - Proud member of the CloudPires team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

View solution in original post

4 REPLIES 4

Michael Jones -
Giga Sage

In your inbound action script, once your conditions are met you can call:

current.setAbortAction(true);

This will prevent the current record from being inserted at the end of the action. 

I hope this helps!

If this was helpful or correct, please be kind and remember to click appropriately!

Michael Jones - Proud member of the CloudPires team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Thanks very much!

This is just what I needed. The email stopped processing and did not create an incident ticket.

Mail logs:

- <inbound email action>: did not create or update incident using current

- Stop processing detected after executing script: <inbound email action>

Excellent, glad I could help!

Michael Jones - Proud member of the CloudPires team!

I hope this helps!
Michael D. Jones
Proud member of the GlideFast Consulting Team!

Mukesh24
Kilo Guru

Maybe you can have a separate Inbound action that catches the email that you don't want an incident to be created for and end the script something like gr.deleteRecord(); or current.deleteRecord(); ?