Hi Alex,
I have a requirement in which i need to create a new record in a different list (lets call it LIST-B) from LIST-A. My current rule setup is as follows in LIST-A:
Rule-A
Trigger based on field change. Checks if a particular field is “Yes” and is changed from initial value. If true, then the action is to prepare an email and then call a function that flags a variable (VARIABLE-A) to true.
In my dffs_PreSaveAction, i am checking if VARIABLE-A == true and if it is then call a function to create the new record in LIST-B with some data from LIST-A. This function is an async function. So i am using the .then().catch() pattern. Depending on the response from the record creating function, i am either returning true, or false (to stop saving). However, no matter what I do inside the then() or catch(), I am not able to stop the form from saving. I am guessing this is due to the new record creating function is async. If that is the case, what are my options to achieve my requirements?
My new record creation function also sets a global variable (newRecordUrl). This is the url of the newly created record. Will setting the variable here work, if the “prepare email” action is using the [[variable:newRecordUrl]] in Rule-A? If this is not possible, what are my options for such requirements?
Greatly appreciate all your help.
Thank you!