This is regarding: https://docs.squidex.io/02-documentation/developer-guides/scripting
This documentation mentions the replace() method a few times but doesn’t explicitly state that it can only be used once, yet when I tried to do something like:
var currentDateTime = new Date().toISOString().split('.')+"Z"; ctx.data.FieldA.iv = currentDateTime; replace(); ctx.data.FieldB.iv = currentDateTime; replace();
Field B does not get replaced (specifically I have ‘Required when publishing’ set for both fields and this is a change script; validation states it cannot progress as only FieldB has not been set).
It’s easy enough to have a boolean variable that you set to true if replace() needs to be called at the end of the script so you only have one call to it, but just felt it wasn’t explicitly clear in the documentation if this is the case.