I have a BPM directive that deletes rows designated child rows of a parent row from QuoteDtl when the parent is deleted.
The problem is that when the BPM is finished the detail tree has not been updated and refers to these child rows that no longer exist.
After I click OK on the error box, THEN the tree is updated and works just fine.
So I set a callContextBpmData field to let the form know a row’s been deleted via the QuoteDtl epidataview notification. It sees it okay and executes an oTrans.Update(). I was hoping this would reset everything, but it just changed the error description.
How might I refresh the tree dataset to reflect the actual contents of QuoteDtl?
Try a trace when you click on the error and see if you can figure out what BO is being called after the error. Then see if you can call that one from your BPM.
I don’t see any reference to the dataset in the trace. There’s a GetDataSetForTree method that runs for the QuoteAsm tree.
Looking at the QuoteDtlTree dataview in the object explorer–it seems it might merely be a copy of QuoteDtl (UD fields and all). My current postulation is that after things settle down, the form copies the QuoteDtl dataset to the tree dataset. Before that happens the tree dataview refers to the QuoteDtl dataview and generates the error. Maybe?
Is this one of the screens that runs a GetDatasetForTree? If so, I have not found a way to refresh the screen without having he user close and reopen the record (the screen can stay open). I suppose I’m a bit surprised. If you would like, we can try to tackle this sometime next week via WebEx. You know how to get ahold of me
The initial error was occurring during the QuoteAsm.GetDataForTree, where there wasn’t a record anymore. I changed that by doing an oTrans.Refresh(), and then got to an error where the form was looking for an index in the main treeview that wasn’t there anymore. I tried refreshes and notifies at different points in the customization, but couldn’t get close enough to the error for them to have any effect.
The current remedy for it is to check in the afteradapter to make sure it’s just come back from the BPM (by setting a context variable in the directive) and throw a BLException, which refreshes the dataset and the form, evidently. The exception text is “Child lines have been deleted,” which looks better than “Error.” It still has “Business Logic Error” in the window title. I don’t know how to change that.
If my change doesn’t hold up I’ll give you a shout.