1 Reply Latest reply on Apr 17, 2015 8:18 AM by philmodjunk

    Script to update fields from one layout to another and capture errors

    JayalakshmiMohan

      Title

      Script to update fields from one layout to another and capture errors

      Post

      Can someone help me with a script for the below requirement

      1) Once a records is added/update in a layout 1 , it should be automatically inserted in another layout 2  as well

      2) If a duplicate entry is added in the source layout 1, it should be created as new record in the destination layout 2

      3) If the record is inserted successfully from layout 1 to 2, an successful message should be stored in layout 3

      4) If the record is not inserted successfully, it must update the error message in layout 3

        • 1. Re: Script to update fields from one layout to another and capture errors
          philmodjunk

          Data is not stored in layouts. Data is stored in the tables on which the layouts are based. Your two layouts can be based on the same table or different tables. Apparently, your two layouts are based on different tables.

          Is there any relationship linking the two tables?

          1) Why is it necessary to duplicate the same data in both tables? This is sometimes necessary, but other times indicates an unnecessary duplication of your data that is best avoided.

          2) Then what should happen if a duplicate is not added to layout 1? Do you mean that a record should be created in #2 regardless?

          3 & 4) Why would a record ever fail to be inserted?