# UD Fields are not being recognized in custom code
**Category:** [Epicor ERP 10](https://www.epiusers.help/c/e10/5)
**Created:** 2017-02-07 22:04 UTC
**Views:** 1555
**Replies:** 4
**URL:** https://www.epiusers.help/t/ud-fields-are-not-being-recognized-in-custom-code/37190
---
## Post #1 by @Alex
when i use logic with any UDField in a custome code BPM epicor didnt recognize the UDFields as part of the table please look below and advise
foreach(var ord in (from comprow in ttOrderHed
select comprow))
{
foreach(var cust in (from comprow in Db.Customer
select comprow))
{
if((ord.Market_c =="SL" || ord.Market_c =="HC" || ord.Market_c =="ID" || ord.Market_c =="MF" || ord.Market_c =="CO" || ord.Market_c =="ED" || ord.Market_c =="PS") &&
(ord.OTSState == "LA" || ord.OTSState == "MS" || ord.OTSState == "AM" || ord.OTSState == "FL" || ord.OTSState == "GA"))
ord.RegionalMgr_c = "MLAURIC";
}
}
---
## Post #2 by @Alex
Never mind guys i got it
---
## Post #3 by @Ashley
Could you share the solution, please?
---
## Post #4 by @zwilli526
Ashley,
When using UD fields in C#, place the field name in quotes and brackets (no decimal after the table name).
ord["Market_c"]
---
## Post #5 by @Alex
the solution is use
Table.UDField("UDField") to get the value of the UDField
Table.SetUDField("UDField","Value") to set the value of the UDField
---
**Canonical:** https://www.epiusers.help/t/ud-fields-are-not-being-recognized-in-custom-code/37190
**Original content:** https://www.epiusers.help/t/ud-fields-are-not-being-recognized-in-custom-code/37190