Jump to content
  • 0

Formula on the Trigger Level


kpcollier

Question

I have a Client Table and a Work Order Table. The Work Order table has a form where you select a client, which provides that client information such as name and address, and says what work needs to be done. I am working on a workflow where if you're filling out a Work Order Form for a client that is not in the Client Table, a trigger will create a new record for that client. 

In the Client Table Form to manually add a new client, there are fields for First Name and Last Name and fields for Address, City, State, etc. There are also formula fields on the table level that concatenate these into one field - Full Name and Full Address. This is where my problem starts with this new workflow.

When entering in new customer info on the Work Order Form, they enter in a full name and a full address. I need to be able to split up these values into multiple fields. In example, the Work Order Form will record a Full Name value, and I need the trigger to split it into First Name and Last Name. I could do this on the table level and make First and Last Name fields a formula, but then they are non editable and totally cancels out the way my Client Table form and Client Update form works. 

Tldr; I need to be able to create a formula in a trigger that will split a field into multiple fields, and I cannot do it on the table level because it makes those fields uneditable. 

 

If there is a better way, please let me know!

 

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

First, I'm not sure why you had to do Full Name and Full Address on your Work Order table when you can structure it the same way as your Clients table (with First_Name, Last_Name, etc... on separate fields).

 

===

On 10/1/2019 at 1:07 AM, kpcollier said:

I could do this on the table level and make First and Last Name fields a formula, but then they are non editable and totally cancels out the way my Client Table form and Client Update form works. 

 

I haven't reviewed the table design and workflow as well. Haha. But I wanted to mention that formula field values can be referenced in the trigger (Read-only).

This means that if you are able to separate the fields you need on a formula field, you may simply set First_Name_Text255 = #inserted.First_Name_Formula on your trigger.

 

Hope this helps

-DN31337

Link to comment
Share on other sites

  • 0
On 10/5/2019 at 3:14 PM, DefinitelyNot31337 said:

This means that if you are able to separate the fields you need on a formula field, you may simply set First_Name_Text255 = #inserted.First_Name_Formula on your trigger.

Thanks, @DefinitelyNot31337. I came into this project with it already done and with many problems - I am trying to fix it the best I can. I don't think the Client side and the Work Order side were originally made to work together, so they seem to be completely different. I have since changed the workflow so they both use first name and last name, and the same for Addresses.

I was looking for an easy way and ended up just changing it to the way it should be. I'll keep this trigger info in the back of my mind, though. I appreciate it.

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