Skip to main content
If you want to update some values in the Before save function, you can use the setOutputValue function:
Where “newOrgNr” is a String value. No extra code is required to update a field. An example here is to summarize all sales connected to a project, then update a user-defined field on the current project.
In this scenario, the script will update the current project with the amount of all sales connected to it. It will not disregard lost sales, so maybe adding a few criteria is a wise choice. You might also want to create a trigger on “After saving Sale” to update the project.
Also, it might be smart to trace the values to see what SuperOffice expects in return, here I have created a user-defined field of the type Decimal, which then expects [F:value] while fields of the type Integers expects [I:value]. You might save yourself some frustrating debugging hours by learning the correct formats.