I am trying to work with a repeat in a form that is in collaboration. I have logic that runs on initialization to determine if a condition is met inside the repeat in the form. I only want this to run on a true initialization (first time opened for the task list), and not run when returning to a saved form.
In addition, very similar, I have tried to run code on only pre-submit, but saving the form sees a save as a submission of sorts.
It has been suggested that I may be able to tap into the pre-submit event evt.evtData, but have no idea where to go from here.
I just want to be able to run code only when either truly submitting the form or truly opening the form from a task for the first time.
You can distinguish between a save and a submit in the preSubmit event by looking at evt.evtData.type this should be one of "Saved", "Submitted" or "Abandoned"