Skip to content

Preventing PostSave Looping

When writing a PostSave ruleset that makes changes to its own document, it is easy to create a situation where the document saves repeatedly, ad infinitum.

To remedy this, we have an include document that contains "safe" updateDocument methods to use for PostSave rulesets.

If there is no overriding need for the self document update to occur in PostSave, move the process to a PreSaveServer ruleset. The document can then be updated by just changing ntf.document, and there is no need to actually call updateDocument at all then.

Caveat

This method adds a property rspsTimestamp, being the date-time the document was updated, to your document. It is this property that tells the ruleset that it has been invoked by a previous PostSave ruleset run very recently (in the last five seconds).

(To be updated for JayRule)