I am going round the twist with this one.
I have a series of BO that are generated to create a complex record. I generate a Header record to then attach a series of OB and PS/PM BOs to.
The creation process is done in a special VP that essentially shows the forms and the progress of the creation process.
To get to the VP I create the Header record attach it to the LIRU and then use that to keep track of what is going on.
The user should be able to cancel the process at any time and return to the home screen.
If the user cancels then I have to clean up the half completed forms and BOs.
If I use DELETE HeaderBO (either as DELETE LIRU.os_HEADER or FIND and DELETE) then I get this error message when the VP has changed back to the home screen
If I use LIRU.os_Header=UNDEFINED then I also get the same error message.
If I find the HeaderBO where the HeaderBO=LIRU.os_Header then the process goes to the homes screen gracefully but the HeaderBO does not get deleted from the database.
but if I just remove the 0000_Header from LIRU then it gracefully deletes the BO as required.
If the user cancels when on the 1000_Contact page I did have it calling the same cancel process as 0000_Header. However that then gives the dreaded error above.
I had it working for about 30 seconds then it stopped again. Interestingly there is a rule on the LIRU that is marked DO not process referred. That flag is being ignored and the rule is being executed, BUT the rule is not re-executed when another change is made to the LIRU moments later. Neither process is doing anything that affects should trigger that rule (it is a READ PROTECT rule on a Y/N switch).
It seems like the process that runs the delete is trying to return to the BO, which is odd as I have other processes that are called from an object and then delete that object.
I now don't know how to delete this no longer needed BO. I could put a flag on it detach it from the LIRU and then run another process to find it and delete it, but that seems messy and unnecessary.