Jump to content
Sign in to follow this  
SarasotaSam

Trigger a Script from a Field Change.

Recommended Posts

I have been stumped on how to have a script trigger when a field has changed. I want the script to be able to trigger without a user entering or leaving a field (meaning it should work with the database unattended).

 

Here is the scenario: When a date in a date field equals today a script is triggered to send an email.

 

Seems like it should be pretty simple, but I have not found a solution yet. Set Script Triggers will not work because it requires a user to exit the field for the script to run.

 

Thanks in Advance for your Help - Sam

Share this post


Link to post
Share on other sites

How is the field changed then if the user does not do it?

 

If it is part of a scripted workflow, let the script take care of the email sending.  You definitely do not want triggers for this.  Triggers are for handling user-level events and in your case you don't have one to handle.

 

An alternate approach would be to create a server-side script to find updated records and loop through them and send the email.  Then put that on a schedule.

Share this post


Link to post
Share on other sites

Example: I have a member whose trial is up on a certain date. I want that end date to automatically trigger a script that sends an email to that member (this is connected to a MYSQL on Wordpress).

 

Thanks Wim for your help - Sam

Share this post


Link to post
Share on other sites

 want that end date to automatically trigger a script that sends an email 

 

But how?  A trigger is based on an event that the user does.

 

It sounds like all you need is a nightly server-side schedule that does a find and loops through the found set to send an email.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

  • Who Viewed the Topic

    1 member has viewed this topic:
    Dr.Who 
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.