UD Fields are not being recognized in custom code

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";
				}
}

Never mind guys i got it

Could you share the solution, please?

Ashley,
When using UD fields in C#, place the field name in quotes and brackets (no decimal after the table name).

ord[“Market_c”]

1 Like

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

2 Likes