![]() |
Cancelling a trigger using an extraction script - Event Date: 01 Nov 2005 - 19 Jul 2006 |
Post Reply
|
| Author | |||
Stephen
Admin Group
Joined: 21 Oct 2005 Location: Stoke on Trent Posts: 1389 |
Post Options
Quote Reply
Calendar Event: Cancelling a trigger using an extraction scriptPosted: 01 Nov 2005 at 11:29am |
||
|
You can use extraction scripts to cancel trigger execution based on specific criteria.
For example, the script below was added to an extracted field:
Will cancel the trigger if the built in field 'From address' is "me@myemail.com". This incoming email will then not be processed by this trigger. Another example:
Will cancel the trigger if the extracted field "customer" does not equal "ACE Clothing" Another example:
Use the LIKE operator to compare against a string with wildcards - as in the above example, the trigger will only be fired if the Field value 'email' is from any email address ending with 'mysite.com'.
Basically - setting the Email2DBTrigger = False in any extraction script will cancel the trigger. You can also set it in the Action script. Edited by Stephen - 29 Jul 2009 at 6:01pm |
|||
![]() |
|||
MSevast
New User
Joined: 20 Jun 2006 Location: Cincinnati, OH Posts: 19 |
Post Options
Quote Reply
Posted: 11 Jul 2006 at 2:51am |
||
|
Is it possible to cancel a trigger when a lookup field fails because of a SQL Server deadlock?
|
|||
![]() |
|||
MSevast
New User
Joined: 20 Jun 2006 Location: Cincinnati, OH Posts: 19 |
Post Options
Quote Reply
Posted: 11 Jul 2006 at 3:01am |
||
|
Here is the error I am receiving. I have added the NOLOCK tip but it does seem to help when the database is being updated during our monthly batch updates. I can't stop the Email2DB service during these updates as I have other triggers that are not dependent on the database and I want to make as much up time as possible.
2006-07-07:15:43:50 *Error lookup field:Timeout expired
2006-07-07:15:43:50 *SQL Was: SELECT TOP 1 UserID FROM PanTable NOLOCK WHERE email = 'myemail@hotmail.com'
Thanks,
Michael
|
|||
![]() |
|||
Stephen
Admin Group
Joined: 21 Oct 2005 Location: Stoke on Trent Posts: 1389 |
Post Options
Quote Reply
Posted: 11 Jul 2006 at 10:34am |
||
|
Hi,
I will add a 'Cancel Trigger If Lookup Fails' option to the lookup field.
Expect this in the next update (later this week).
Thanks
Steve
|
|||
![]() |
|||
MSevast
New User
Joined: 20 Jun 2006 Location: Cincinnati, OH Posts: 19 |
Post Options
Quote Reply
Posted: 11 Jul 2006 at 3:07pm |
||
|
Thank you very, very much for all the rapid attention to the issues!!!!
|
|||
![]() |
|||
MSevast
New User
Joined: 20 Jun 2006 Location: Cincinnati, OH Posts: 19 |
Post Options
Quote Reply
Posted: 14 Jul 2006 at 5:10pm |
||
|
Steve,
Have you had any success incorporating this change into a new build?
If the trigger is cancelled, and I have delete Processed and Delete All Checked emails, will this prevent the message from being deleted? I need to make sure I don't purge these records so that I have a shot at getting them into the DB once the issue that is causing the deadlock resolves itself.
Michael
|
|||
![]() |
|||
Stephen
Admin Group
Joined: 21 Oct 2005 Location: Stoke on Trent Posts: 1389 |
Post Options
Quote Reply
Posted: 18 Jul 2006 at 2:02pm |
||
|
Hi,
The build is now posted.
Select Help - Check For Updates to download it.
Thanks
Steve
|
|||
![]() |
|||
MSevast
New User
Joined: 20 Jun 2006 Location: Cincinnati, OH Posts: 19 |
Post Options
Quote Reply
Posted: 19 Jul 2006 at 5:04pm |
||
|
Until the Help file is updated, can you give me a quick rundown of what is cancelled when the 'Cancel Trigger If Lookup Fails' happens. I need to make sure the message is not deleted so it can be reprocessed at another time. The delete message setting is at the account level so I am worried a trigger failure will not stop the message from being deleted.
Thanks,
Michael
|
|||
![]() |
|||
Liam
Admin Group
Joined: 29 Jun 2011 Location: Stoke-on-Trent Posts: 137 |
Post Options
Quote Reply
Posted: 29 Sep 2011 at 7:34pm |
||
|
Here is a script that will compare the first two characters of an extracted field with another value, if the two values match then the message will continue to process as normal, if they don't then processing of that message will be cancelled. Here is a link to a description of the Mid function - http://www.w3schools.com/vbscript/func_mid.asp The first number dictates where the new string is to begin, 1 is the first character, the second number tells Email2Db how many characters to extract after the starting point. Dim extract As String Dim comp As String comp = "{string}" 'The string that will be compared 'Convert the extracted data to
upper case (means that different cases will be matched the same)
'and then get the first two characters of the extracted string extract = UCase(Mid(Email2DBExtract, 1, 2)) 'Compare the first 2 letters of
the extraction to the string RA End
Sub Edited by Liam - 30 Sep 2011 at 1:34pm |
|||
![]() |
|||
Post Reply
|
| Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |