I have a app where a traveler can record their vehicle based trips and campsites. When a user records their campsite for the night it is also an expense so data is added into two “Types” that is data type Day Summary and data type Expense. All works well with the workflow having two steps.
So that the correct expense is edited when required I gave the Day Summary a 7 digit random alpha-numeric string when created and and give the Expense the same string
Editing the Day Summary also works as intended and the workflow also has two steps
To ensure the correct expense is edited I have this
All works as intended and each time the Day Summary is edited the Expense also edits correctly.
So all is good until a user wants to Delete a Day Summary. I used the same logic to delete the Expense as well as the Day Summary
Then
The Day Summary deletes OK but wrong expense is deleted.
When I run the debugger I find that it is not finding the id
The first expense in the database is deleted and not the one constrained to the correct id
What am I missing?? The edit works OK with the same constraints so why not the delete??
Thanks in advance for any advice