How to use UpdateExt in BPM

,

I’ve heard of using UpdateExt as a possible workaround when something needs to be slightly more flexible.

I’d like to try it to solve a current situation I’m having updating a PO Detail in a BPM.

How do I populate the UpdExtPO Tableset with just the minimal information required to update? I’m used to a GetByID method to fill my tableset and then I edit the appropriate fields. I’m missing a step here, though. How do I fill the UpdExtPO tableset?

I’ve just used the “Fill Table by Query” widget in the past when I can’t find a function that returns the right tableset. You just need the key fields and the ones you are updating generally.

2 Likes

I also asked this question. I use a fill table by query widget as well to copy the data from the getbyid dataset to the tables I need to update in my UpdateEXT dataset.

I am with Adam, I just include the main header table and then any other tables and rows I need to update and it seems to work…

1 Like

So I’m currently using a Data Directive and don’t get the Fill Table by Query. However, I am able to seemingly fill the table using code. I did confirm that using the DMT, it does update the record - and I thought the DMT used UpdateExt. The BPM does not uncheck the RcvInspectionReq flag, though. :frowning:

Here’s my code:

        IceRow newRow = dsPOUpdExt.PODetail.NewRow();    
                
        if (newRow != null)
        {
          newRow["Company"] = "VANAIR";
          newRow["PONUM"] = eachPO.PONUM;
          newRow["POLine"] = eachPO.POLine;
          newRow["RcvInspectionReq"] = false;    
        
          dsPOUpdExt.PODetail.Add(newRow);
          
          var allRows = (from h in dsPOUpdExt.PODetail
                 select h);
          
          foreach (var eachRow in allRows)
          {
            msg += "Company: " + eachRow.Company + "  PO: " + eachRow.PONUM.ToString() + "  Line: " + eachRow.POLine.ToString() + "  RcvInspectionReq: " + eachRow.RcvInspectionReq.ToString() + "  Part: " + eachRow.PartNum + "\n";
          }
        
          bool errorsOccurred = false;
          boPO.UpdateExt(ref dsPOUpdExt, true, false, out errorsOccurred); 

The bit in the middle is constructing a message to show me what the table has in it. It produces this message seemingly indicating that the table is getting populated like I’m expecting.
image

Why won’t the update happen? I bet I’m missing something simple…

1 Like

As Rich points out, I needed to also populate the Header record. My code was only populating the Detail record. Once I filled the POHeader table also, it worked as I expected. Whew!! I was thinking I might not get this done today… Thank you to everyone who took time to help me!!

3 Likes

That’s definitely needed haha. I was also doing that the other day- contemplating whether I needed the header record in my UpdateEXT dataset. I just included it assuming it was probably necessary, but as you have pointed out, it most certainly IS necessary even if you aren’t changing anything on it.

Remember that all you need on parent lineage records are the key fields. Using Sales Order as an example, if you want to use UpdateExt to update a field on the Detail row, you only need to populate Company and OrderNum on the Order Head table. If you want to update a Release line, you need the Order Head Keys and the Company, OrderNum, and LineNum fields from the parent Order Detail row.

5 Likes

@Rich, Your post that I referenced above did a great job of setting me straight. I appreciate your thorough input on that thread because it really cleared up what was happening. And I feel competent moving forward now.

There is some more details on it:

https://www.epiusers.help/t/bpm-best-practice/92146/8

3 Likes

Thanks Rich, I remember it being a very limited number of fields but couldn’t remember which ones, so I was using pretty much every header field :sweat_smile:, this helps slim that down!

Thanks Haso.