Jump to content
  • 0

Tailoring a Trigger to a Certain Field


kpcollier

Question

I have two tables, Est_Table and Job_Table.

Est_Table is filled with a ton of "bids" - Jobs that we are trying to secure. The fields in Est_Table consist of a BidID, Project_Name, Contractor_Name, and a Yes/No for Bid_To_Job (If a bid turns into a job, you check it).

I am trying to set up a trigger in the Est_Table. I need to tailor the trigger to only work when Bid_To_Job is updated. My goal is that when an entry in the Est_Table is updated to a Job, the entry (BidID, Project_Name, etc.) is automatically copied to the Job_Table.

I have it set up so everything copies over to the Job_Table if ANY field is updated in the Est_Table. Also, I am unsure why I can't select the Bid_To_Job field (is it because its a Yes/No data type?).

 

Screenshot (2).png

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

Hello kpcollier,

Your Bid_To_Job field can be selected even if it is a Yes/No.

I tried it on my end, and it worked. I think, your Job_Table_Example does not have a Bid_To_Job field, that's why you cannot select it.

You can refer to this screenshot for the triggered actions:

image.thumb.png.1ded84d2151dae56ab438656cdfffff8.png

These are the tables that I used:

image.png.c50fad743ed32b4ef1fdf1c98b39a94f.png

image.png.9e0239f70d6ce6d39566bbbb8ce48e29.png.

Hope this helps.

 

-JolliBeng

Link to comment
Share on other sites

  • 0

@JolliBeng Thank you! That is almost what I need. With the trigger you supplied, an entry from the Est_Table will be copied over if ANY field is updated in the entry. I am trying to make it so only the update of Bid_To_Job copies the entry over. I will be trying to figure this out. Thank you for your help and getting me started!

Link to comment
Share on other sites

  • 0

Thought I figured it out. LOL. Oh well. I entered that trigger I previously posted into the end of the Est_Table trigger, that initially copies over the entries. So, now, it SHOULD work as anything updated gets sent to Job_Table, but anything that doesn't have Bid_To_Job as true is deleted. But, nothing is copying over anymore. On to the drawing board again.

Link to comment
Share on other sites

  • 0

Hello kpcollier,

If you want to copy all the updated data from EST_Table to Job_Table and delete the data that has a checked Bid_To-Job, you may use this:

image.png.f2d95583d6007c023ff09ad02e1095f4.png

But if you only want to pass the values of the updated data from EST_Table to Job_Table without changing the status the Bid_To_Job on the Job_Table, you just need to remove it on your insert into statement like this: 

image.png.c1a634d5b216ccf9ed299da044df0f9d.png

 

-JolliBeng

Link to comment
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
Answer this question...

×   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.

Loading...
×
×
  • Create New...