How to use field in Record rules to insert and update?

I have a form that I have some record rules on. However I've run into a problem with the way record rules work... Here's what I'd like to do, and I'm looking for suggestions..

When the submit button is pressed, I want the Record Rule to do two things..

Insert a connected Record, based on the fact that the field Approved is YES, and that the "Invoice Sent" field is set to NO

Update the "Invoice Sent" field to YES, so that I don't accidentally do this again..

However, Update rules run first, so the "Invoice Sent" is getting set to YES, which means my connected Insert is not firing..

How are people getting around this type of issue?

Thanks. .

So, here's what I did to solve this...

I created a count field in my master record, and in the record rules allowed an update only if the count < 1.

Thanks for the suggestions.

Ok so your trying to update and insert NEW records based on values not yet in the object fields but the content in the same form? This is what I was saying previously and what I just got from your comment "That doesn't work because the update runs before the insert...'

Can you email me It might be worth giving me a log into the front end of your app so I can take a look. There's other stuff we can try if the above is correct.

This is what I was attempting to do that isn't working.. I'm not sure how the above helps, but I could be missing something.. :)

That doesn't work because the update runs before the insert...

Already set, great so the form is updating an existing record right?. But based on the fact it's yes you want to insert/update certain values.

Then try the "add criteria" to set the record how you want it

Ok, So the form record is Law Office... The form has the setting the approved field to Yes.

The Invoiced field has a default value of No, and is already set, since this last step is from a multi step form process.. This is the field I want to set to Yes, after I've inserted the new record into the Invoice table..

I think that answered question 1.. :)

99.9% sure I can fix this for you tbh.

Ok so is the yes or no entered in the same form that you want to add the criteria into? or is the yes/no already set in the object?

2nd question depends on my one above

feel free to pop me an email. Just want to help (it's free) :)

So I talked to support on this, and got a reason why it doesn't work.. Now to find a solution..

I have a record that I want to insert in a table, however I only want to insert it once..

So I have Law Office object with fields submitted and Invoiced, and an Invoice record object and I have two record rules..

1) that inserts a record into the Invoice record when submitted is Yes and Invoiced is No

2) update the current record to set Invoiced to Yes..

However, update record rules run before insert record rules.. So the insert never fires because the Invoiced is already set to Yes...

Any suggestions on how to manage state in this scenario?

Hi Julian,

This is quite straightforward to do you can simply add a criteria if any action is inserting, or updating connected records. You will see "action", "when", and "values".

Where in the middle, 2 option "when" . It says when you can click on "add criteria" to show options to add a criteria based on record rules in that object.

However, can I ask are the rules/criteria for that form already set in the object fields or in the same form? Might have a workaround for this but might be handy to know a bit more.