Custom UD FIelds in BPMs

I have rarely run into time where the built-in UD Fields of E9 are not enough, but I have an example now.
We have created some new UD Fields in a few tables and regenerated the datamodel. This has allowed us to create customizations with the new fields, but I cannot reference the UD fields in a BPM (for instance ttQuoteDtl.MyField_c). Is there special logic for Method Directives or Data Directives that I am missing?

I ran into this and got this code from support as an example.

FOR EACH ttcustomer WHERE ttcustomer.rowmod = 'u'.
  FOR FIRST customer_ud WHERE ttcustomer.sysrowid = customer_ud.ForeignSysRowID EXCLUSIVE-LOCK.
   IF avail customer_ud THEN DO:
       ASSIGN customer_ud.shortchar999 = 'value goes here'.

That make sense if I’m getting the value from the database.
How would I reference that field in a Pre-Processing Method Directive?

This is from a PP - MD

FOR FIRST SugPODtl_ud WHERE SugPODtl.sysrowid = SugPODtl_ud.ForeignSysRowID exclusive-lock.
	message " Found sugPODtl_UD - CB09 is " + string(SugPODtl_UD.CheckBox09).

     	Assign UD02.CheckBox09 = SugPODtl_UD.CheckBox09.  /* Conflict Minerals  */

IN E9 you have to JOIN yourself.

for each ttQuoteQty,
first QuoteQty_UD WHERE QuoteQty_UD.ForeignSysRowID = ttQuoteQty.SysRowID.
	IF (ttQuoteQty.QuoteNum ne QuoteQty_UD.QuoteNumRef) THEN DO:
		assign QuoteQty_UD.QtyNumRef = ttQuoteQty.QtyNum.
		assign QuoteQty_UD.QuoteLineRef = ttQuoteQty.QuoteLine.
		assign QuoteQty_UD.QuoteNumRef = ttQuoteQty.QuoteNum.

Even if you use the _UD Table on a RDD you would need to add the table to the RDD and Join, it doesnt have a magical view like E10.

In E10, I could have this:

foreach (var tt in ttQuoteHed.Where(tt => tt.Added()))
   tt.DateStamp_c = DateTime.Today;

In ABL, I would do this:

for each ttQuoteHed where ttQuoteHed.RowMod = "A".
   ttQuoteHed.Date01 = Today.

However, if I wanted my own UD fields…

for each ttQuoteHed where ttQuoteHed.RowMod = "A".
   ttQuoteHed.DateStamp_c = Today. /* This does not work */

You would need

for each ttQuoteHed where ttQuoteHed.RowMod = "A",
first QuoteHed_UD WHERE QuoteHed_UD.ForeignSysRowID = ttQuoteHed.SysRowID.
   assign QuoteHed_UD.DateStamp_c = Today.
1 Like

Not sure that makes sense @hasokeric. I could be wrong though.
If the ttQuoteHed row is being added, then the QuoteHed_UD row does not yet exist, right?

Unfortunately thats the only way to do it in E9. You would have to know where you are putting the code. In a Data-Directive it might be there, while in a Method Directive, depending on the method you might have to do it in the POST.



At this time, you have to use ABL code to do the join with the _UD table by using the sysrowid of the parent and the foreignsysrowid on the _ud table. For example, if you added some columns to the customer table and you wanted to update customer_ud.shortchar999, you could do so with the ABL code below.

Got it. It makes sense now that I know it wasn’t fully completed until E10.