# How to reference a UD Field from another Table

**URL:** <https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521>\
**Category:** Kinetic ERP\
**Tags:** kinetic, customization\
**Created:** [February 7, 2024, 7:20pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521 "2024-02-07T19:20:02Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![James\_Morris](https://www.epiusers.help/user_avatar/www.epiusers.help/james_morris/32/40866_2.png) [@James\_Morris](https://www.epiusers.help/u/James_Morris)\
**Post date:** [February 7, 2024, 7:20pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/1 "2024-02-07T19:20:02Z")

</div>

We have created a custom ud field for the Part table and added the corresponding check box in app studio. It is saving and working fine. We now would like to reference that field when we add that part as a line item. When you add a line and give it a part number it brings the description over along with other properties from the Part table. We would like to include the custom field we have added to the OrderDtl table also. After some research we tried using Extended Properties Maintenance. We added a custom ud field to the OrderDtl table that matched the one in the Part table. We then went to Extended Properties Maintenance to the OrderDtl\_UD table and added the matching Part field. The default OrderDtl has extending properties and I assume that is how OrderDtl references PartNum , LineDesc etc from the Part Table? After all of that we ran a BAQ with OrderHed, OrderDtl and Part displaying the custom ud fields. The custom ud fields from OrderDtl do not match the Extended fields from the Part table. I included a screen shot from the default OrderDtl extended property and the one we created. One difference is the default OrderDtl extended property has Part and PartNum in the Default Properties section but they are grayed out. The one we created does not have Part\_UD or the ud field. Any ideas?

default OrderDtl → PartNum Extended fields

 ![image](https://www.epiusers.help/uploads/default/original/3X/9/c/9cb21b21ab2442884d27f4091cfa6c9f0e01a6a3.png)

our OrderDtl \_UD → CUSTOM\_UD\_FIELD Extended fields

 ![image](https://www.epiusers.help/uploads/default/original/3X/2/3/23dab29d226a583592492a1a9519153a258ac1b5.png)

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [February 7, 2024, 8:55pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/2 "2024-02-07T20:55:38Z")

</div>

I use a post processing bpm on SalesOrder.ChangePartNumMaster to get the Part data.

---

<div class="post-metadata">

**Author:** ![James\_Morris](https://www.epiusers.help/user_avatar/www.epiusers.help/james_morris/32/40866_2.png) [@James\_Morris](https://www.epiusers.help/u/James_Morris)\
**Post date:** [February 7, 2024, 9:46pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/3 "2024-02-07T21:46:00Z")

</div>

@gpayne Thanks for responding. The reason for adding the ud field was to be able to disable or hide a button based upon whether the field was true or false. The button is located on the Lines card inside sales order entry. So depending on which row is active I need to read the data view of OrderDtl.CUSTOM\_FIELD for that item and either enable or disable the button. In the screen shot the bottom 2 lines have a (boolean) field that is true and the top 2 are false in the Part table. They are all false in the OrderDtl table. I am trying to disable the button for the top 2 and enable it for the bottom 2.

 ![image](https://www.epiusers.help/uploads/default/original/3X/1/2/12d32c43e2d758516951e01e2fb75ff513cb8202.png)

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [February 7, 2024, 10:17pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/4 "2024-02-07T22:17:51Z")

</div>

First do the bpm to copy the Part.Configurable\_c to OrderDtl.Configurable\_c and make sure the data shows.

Then in app studio make a data rule to enable/disable the button based on that value. Pg 206 of the app studio guide.

---

<div class="post-metadata">

**Author:** ![James\_Morris](https://www.epiusers.help/user_avatar/www.epiusers.help/james_morris/32/40866_2.png) [@James\_Morris](https://www.epiusers.help/u/James_Morris)\
**Post date:** [February 9, 2024, 2:17pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/5 "2024-02-09T14:17:59Z")

</div>

@gpayne We are trying to do a Method Directive to copy the Part.Configurable\_c to OrderDtl.Configurable\_c. We have only done a couple of bpm courses. We have isolated the method that runs after you enter the Part on a new line item and press enter or tab. It is the SalesOrder.ChangePartNumMaster. We have it displaying a message when we do this. We are kinda lost at this point. Not sure how to access the Part table or ,once we do, update OrderDtl table. We found the “Epicor Kinetic BPM Cookbook” but do not see an example that does this. We have experience with c#. Any pointers?

---

<div class="post-metadata">

**Author:** ![gpayne](https://www.epiusers.help/user_avatar/www.epiusers.help/gpayne/32/55751_2.png) [@gpayne](https://www.epiusers.help/u/gpayne)\
**Post date:** [February 9, 2024, 4:33pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/6 "2024-02-09T16:33:49Z")

</div>

@James_Morris This is easy with a widget, but I also did a c example.

Update Table by Query will do this since partNum is already a parameter.

 ![image](https://www.epiusers.help/uploads/default/original/3X/a/8/a89bb526aca3c032fe8e4af549f522b6d38cffef.png)  
Query  
 ![image](https://www.epiusers.help/uploads/default/original/3X/3/4/3499c730c4586aca55697f29b869b8c66d550368.jpeg)  
Fields  
 ![image](https://www.epiusers.help/uploads/default/original/3X/d/d/dd4aa343bfcf3641b1b61e97ab768acc21ce0118.png)  
Binding  
 ![image](https://www.epiusers.help/uploads/default/original/3X/0/1/01a575a138622d482f7586372ba086d3981b2c11.png)

code Not tested. You could also use the parameter partNum

```auto
foreach (var ttOrderDtlRow in (from ttOrderDtl_Row in ds.OrderDtl
                                     where ttOrderDtl_Row.Company == Session.CompanyID
                                     select ttOrderDtl_Row))
{
   
    var sc01 = Db.Part.Where(w => w.PartNum == ttOrderDtlRow.PartNum).Select(s => s.ShortChar01).FirstOrDefault();
    
    if (sc01 != null)
    {
        ttOrderDtlRow.SetUDField("ShortChar01",sc01);
    }
            
            
}

```

---

<div class="post-metadata">

**Author:** ![James\_Morris](https://www.epiusers.help/user_avatar/www.epiusers.help/james_morris/32/40866_2.png) [@James\_Morris](https://www.epiusers.help/u/James_Morris)\
**Post date:** [February 9, 2024, 5:44pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/7 "2024-02-09T17:44:56Z")

</div>

@gpayne The widget worked. I have not tried the c# but it looks like it would work.

---

<div class="post-metadata">

**Author:** ![KPreda](https://www.epiusers.help/user_avatar/www.epiusers.help/kpreda/32/27628_2.png) [@KPreda](https://www.epiusers.help/u/KPreda)\
**Post date:** [February 9, 2024, 5:53pm UTC](https://www.epiusers.help/t/how-to-reference-a-ud-field-from-another-table/111521/8 "2024-02-09T17:53:50Z")

</div>

Thanks, what a coincidence I happened to need this exact thing!
