Changes to DemandHead Reflected in DemandDetail BPM - Help Needed

We are making an updated dashboard for the DemandHeader and DemandDetail tables. When changing the DemandHeader.OrderNum field we would like the corresponding DemandDetail.OrderNum to change as well.

Any ideas on how to do this through Method or Data directives?

Option 1 would be to edit the base processing directive on the uBAQ BPM for your uBAQ to update the ordernum for each DemandDetail line.

Option 2 would be to put a post-processing directive on the uBAQ BPM, and Invoke the DemandEntry BO to call UpdateExt Method, and update each DemandDetail record.

Option 3 would be to add a data directive on DemandHeader with the condition that OrderNum has changed, and invoke the same method in option 2 above from there.

2 Likes

Kevin,

I opted for option 1 as it seemed simple enough. Having stood up the base bpm with the following settings:

Fill Table by Query 1

image

Invoke BO Method 1

image

image

The two message boxes in there can be ignored as the first just gives me a readout of the data before the updateext runs and the other just tells me when its done.

The data shown in the message box seems to say it should update correctly:

image

But when I checked the detail entries after they were still the original number, not the one I had entered (ie 2222).

Ideas on anything I missed?

1 Like

My first thought is that it hit an error somewhere. Can you create bpm level bool variable (called HasErrors or something), and assign it to that 4th parameter of DemandEntry.UpdateExt, and add a condition after that to show a different message if the HasErrors variable is true?

1 Like

Right on the money!

Error provided by system:

Does that mean that I need to pass along DemandHeader info as well as DemandDetail in order to get updateext to work properly?

Looking back at that, I think there’s a little more that needs to be done. You’re passing in the BAQ Results with updated rows, but the ds that UpdateExt is expecting is probably a full DemandEntryTableset.

If I’m right, this may be just a little more complex than I expected. First you’ll need to create a new variable of type DemandEntryTableset using the “Choose Type” option when setting BPM variables:

Then you’ll need to invoke GetByID from DemandEntry:

Then do your Fill Table by Query using that Tableset, instead of your Query Results tableset:
image

1 Like

This worked perfectly! Thanks a ton for the help!

1 Like

Awesome! Happy to help!