Parker Software Ltd Homepage
Forum Home Forum Home > Email2DB Email Parser > Scripting > Scripting Samples
  New Posts New Posts RSS Feed: Custom Unique ID Field
  FAQ FAQ  Forum Search   Calendar   Register Register  Login Login

Custom Unique ID Field - Event Date: 30 Jan 2006 - 30 Jan 2006

 Post Reply Post Reply
Author
Message
Stephen View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 Oct 2005
Location: Stoke on Trent
Posts: 1389
Post Options Post Options   Quote Stephen Quote  Post ReplyReply Direct Link To This Post Calendar Event: Custom Unique ID Field
    Posted: 30 Jan 2006 at 2:30pm
You can create fields in Email2DB and assign them custom values using 'Extraction Scripts'.

This sample shows how you can create a custom ID field that will increment for each email processed.

See: http://www.email-2-db.com/images/script-customidfield.gif

Create a field in Email2DB. On the Extract Data tab click the Extract Script option and click the Edit button. Enter the script and save it.

You can also use extraction scripts to alter values previously extracted from the email. The Email2DBExtract variable will contain the data extracted by Email2DB. You simple use the script to alter its value.
Back to Top
Daniel View Drop Down
Admin Group
Admin Group
Avatar
Technical Director

Joined: 19 Dec 2006
Location: Stoke-on-Trent
Posts: 875
Post Options Post Options   Quote Daniel Quote  Post ReplyReply Direct Link To This Post Posted: 01 Dec 2009 at 4:40pm
Sub Main()

     Dim LastID as Long

     LastID = GetRegistry("Variables","ID",0)
     LastID = LastID + 1
     SetRegistry "Variables", "ID", LastID

     Email2DBExtract = LastID

End Sub
Daniel Tallentire
Support
Parker Software
Back to Top
swhiteman View Drop Down
Expert
Expert


Joined: 13 Mar 2008
Location: NYNY
Posts: 258
Post Options Post Options   Quote swhiteman Quote  Post ReplyReply Direct Link To This Post Posted: 01 May 2011 at 7:30pm
Is there not a synchronization problem in this script?

You're not doing any locking before reading that Registry entry, so another script could get and write the same values.

Or do all scripts actually only run in one thread?
Back to Top
Stephen View Drop Down
Admin Group
Admin Group
Avatar

Joined: 21 Oct 2005
Location: Stoke on Trent
Posts: 1389
Post Options Post Options   Quote Stephen Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2011 at 3:02pm
Scripts run in one thread so there is no sync issue.
Back to Top
swhiteman View Drop Down
Expert
Expert


Joined: 13 Mar 2008
Location: NYNY
Posts: 258
Post Options Post Options   Quote swhiteman Quote  Post ReplyReply Direct Link To This Post Posted: 02 May 2011 at 7:39pm
OK, are scripts the only things that block triggers?  Is simultaneous processing capacity higher (no lock waits) if there are no scripts?
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down



This page was generated in 0.156 seconds.
These are the forums for Parker Software, developers of Live Chat Software: WhosOn and Email Automation Software: Email2DB.