Hello brains trust - hoping someone can help with this:
BACKGROUND
I have an app with a REPAIR table with a related REPAIR HISTORY table (1 to N). When updating a REPAIR, I create a related record in the REPAIR HISTORY table using a record rule. Shows what changes over time, who changed it, etc. That all works fine.
NEW CIRCUMSTANCE
Client wants to be able to attach photos (up to 3) to REPAIR HISTORY. Given my app is really updating the REPAIR table to create a REPAIR HISTORY record, those 3 photos need to be fields in REPAIR table, and then get written across into REPAIR HISTORY using a record rule. That all works fine.
WHAT DOESNT WORK
The next time the client updates that REPAIR, those photos are still in the REPAIR table and will pre-populate the fields on the update page. Which is not what they expect - they expect 3 empty fields to add new photos to history. So I am looking for a way to ERASE these images from the REPAIR table, but AFTER the related REPAIR HISTORY record has been created.
I tried using another following record rule to null out those fields, and that works, but it works FASTER than the record rule to create the REPAIR HISTORY record, and so nothing gets saved in history. It seems to me that record rules must fire concurrently, not in the order they are listed.
And deleting those 3 fields is clearly faster than creating a new record. Which brings me to my questions:
Is there a way to ensure that one record rule completes before the next commences - i.e. set some order of precedence in record rules?
or
Is there a way to null out a field when LOADING a page? This would resolve the issue because the user would see empty fields ready to accept new images
or
Any other suggestions on how I might make the above scenario work? Maybe a code snippet to set the fields to null on page load?
regards
Leigh