BPM to record changes in UD table?

@Chris_Conn @knash Thank you both for taking the time to troubleshoot with me!

I made sure the RowMod was set to “A”, it’s still not filling the table with anything though. Here are some screenshots, I’m not sure where I’m going wrong:

  1. BPM design 1 Design

  2. BPM variables

  3. Fill UD08 settings

  4. Query fields

  5. Mapping

  6. UpdateExt UD08 settings

  7. Parameters 7 Parameters

You need the GetaNewUD08 widget as well.

Here is a picture of the update.
BO: Ice.UD12
Method: Update

@knash A few questions - my apologies, just trying to learn from this for future reference!

  • Would the GET be placed before or after the FILL TABLE that I have (or replace it)?
  • Is there a reason why I would use UPDATE (like you have) versus UPDATEEXT that I currently have?
  • Is there a way I can insert a widget between two widgets in the Designer? I’m not seeing a way to do that, or to remove widgets once they’re added, which seems like rudimentary stuff that I must be blind to, ha!

Correct GetaNew would be first. Sorry I thought you could read my brainwaves from the picture I posted yesterday.

You should be able to add widgets to what you have. If you click on the connector lines you can delete them. Then you can redraw them in the order you want.

Widgets
GetaNewUD08 (The picture show what the widget is calling)
BO Ice.UD08
Method Name: GetaNewUD08
for the parameter you can the one you have or create a new one.

2)FIll Table

  1. Update

I believe the UpdateExt is deprecated, smarter folks can chime in.

@knash Oh, I think you’ve got me so close to a solution! Now I believe I’ve run into a different issue - when testing the BPM by changing a sales order and clicking save, I’m getting an error that the record is already in the UD08 table. I’m assuming this is because the Key I assigned isn’t actually unique. I’ve got it set up to be a combination of the Order Num + Order Line + Price + Qty + Date, so I’m not sure why it wouldn’t be considered unique whenever a sales order is updated, since one of those values (price, qty, or date) would always be changed.

Is there a way to assign an auto-generated unique key to every single new save in a sales order?

@timshuwy has a great pdf for this.

1 Like

@knash I may be far over my head with this one… I tried my best to review the PDF and the C# code included in it, but I am honestly at a complete loss on how to change up the BPM and code to apply to my situation (setting a field in a UD table) versus the example use case of applying it to an ERP field.

What’s got me confused is that I’m getting the Duplicate Row Error, but there’s only one row in the UD table and all of the fields are empty.

You can add a key that is Guid. Perhaps the easiest way is to map your source rows sysrowid to an empty key field in the dest UD row

1 Like

This is for the UD13. You will want to do this for UD08

ud table creation.pdf (223.0 KB)

Great call @Chris_Conn set a key like key5 to Guid

I like to make things complicated.

1 Like

@knash @Chris_Conn These both seem like great solutions! I tried to test Chris’ solution first with using the SysRowID as Key1, but I’m running into a separate issue. To test it, I go to the Order Entry module and change the selling quantity, then click save (which should add the record to the field). Then I pull up my UD table in a BAQ, which shows that a record has been added, but all fields are completely blank. Then I go back to the same sales order and change something else on it, but this is where I get the Duplicate Row Error and am unable to save any additional changes to the sales order.

I think my issue may be happening due to binding… should the tt fields be empty? Or should I be using ds fields instead?

I think you have two things going on.

The sysrowid might not work as you may have multiple updates on the same record you are monitoring.

try the SysRevID.

What is your query for the fill table? You can hardcode a few to test. Then once you know the creation is working we can focus on getting the real data filling in.

@knash I switched SysRowID to SysRevID, still getting blank records and the Duplicate Row Error (most likely because all fields are blank?).

My query is shown below, except with the addition of SysRowID and SysRevID to the columns.

What does the phrase build look like as well?

@knash

image

Variable is now “NewUD08” and set to UD08Tableset.
Both GetaNew and Update reference the NewUD08 variable.
Fill widget is set with the query and mapping in my previous screenshots.

sorry I am an it guy so clear communication is hard for me. :slight_smile:

I mean this.

Plus you may want to use the Update Table by Query widget. notice the vertical line vs horizontal line

@knash Ah, I’m so sorry! Thank you for being so incredibly patient with me. Our IT guy uses me for writing SSRS reports and BAQs, and he’s now slowly getting me into adding custom fields, user codes, and now BPMs. I’m loving what I’m learning, but it’s a lot of trial and error and “d’oh” moments! I also only just started a course on SQL, and seeing this C# coding is definitely muddying my brain, ha.

OrderNum is the relation between OrderHed/OrderDtl, and OrderNum and OrderLine are the relations between OrderDtl/OrderRel (and obviously Company is used for both relations as well).

that looks fine. try the update table widget.

As for you keys
Try this in the binding. These are expressions.

key3
System.Guid.NewGuid().ToString()

key4
BpmFunc.Now().ToString()

@knash I’m still trying your solution out, but just curious - why would I choose the Update Table (vertical) instead of the Fill Table (horizontal), when what I want to accomplish is adding new records to the table each time an order is changed?