AnsweredAssumed Answered

Scripting help

Question asked by Vicky on Dec 11, 2013
Latest reply on Dec 18, 2013 by Vicky

Title

Scripting help

Post

     Hi everyone,

     I have two tables, one is called shipmentline and the other is called containers. Shipmentline has two fields, container1 and container 2.  Container has a field called container.  What I wanted was that when a user puts in a name into shipment::container1, a new record will be created in container table and container::container will have the same name.  When a user puts in a name into shipmentline::container2, a new record will also be created in the container table and container::container will have the container2 text.  When something is modified in shipmentline::container1 or 2, container::container should reflect that change and not create a new record. 

     I have set the scripts using onobjectexit script trigger , one for container1 and one for container2 for the fields in shipmentline. I don't know what to put as the condition in my if statement.  Right now it's [not IsEmpty(shipline::container1)] but this will create a new record in container table everytime i go back to modify something or when I go back to previous records to add something in container2 , two records, one for container1 and the other for container2 will be added in the container table.  

     Is there anyway to do what I wanted without a script? Otherwise, which script trigger should I use and what should I put as the if statement condition?

Screen_Shot_2013-12-11_at_12.15.38_PM.png

Outcomes