Automatically Copying Field Values in SBM

Hi everyone!

I'm exploring the best approach in SBM to automatically copy the value of certain fields (like 'First Name') into corresponding 'Original Value' fields upon submission in the same table. Any recommendations or best practices for achieving this efficiently? I  was thinking of using JavaScript, but I want to double-check if there is another way to do so.

Thanks in advance for your insights!

Parents
  • Verified Answer

    +1

    I solved it by adding a ModScript:

    var record = Shell.Item(); // Get the current item

    // Get the current value of 'Received Date'
    var receivedDateValue = record.GetFieldValue("Received Date");

    // Copy the 'Received Date' value to 'Received Date Original'
    record.SetFieldValue("Received Date Original", receivedDateValue);

    record.Update(); // Commit the changes to the database

Reply
  • Verified Answer

    +1

    I solved it by adding a ModScript:

    var record = Shell.Item(); // Get the current item

    // Get the current value of 'Received Date'
    var receivedDateValue = record.GetFieldValue("Received Date");

    // Copy the 'Received Date' value to 'Received Date Original'
    record.SetFieldValue("Received Date Original", receivedDateValue);

    record.Update(); // Commit the changes to the database

Children