2 notes - first this will only work if this is a PRE process
Next, are you sure that The custom fields you are referencing are on those tables you are referencing?
others are faster than me sorry for the extra post you are close just make sure the variables are what they should be and then using UD fields are sometimes a bit tricky.
Can you explain what you mean in by “declare a variable as ttInvcDtl_xRow but then call ttInvcDtl”
I also rewrote the code as suggested above and it still gave me the same error. I think I am going to read the UD fields (as different names) and try it again. Maybe the field are just corrupted?
@Chris_Conn, we verified that everything is syncing properly. I recreated the 3 fields that were erroring out and did a regen and still getting the same error but only for the InvcDtl fields. Here is the code:
Erp.Tables.OrderDtl OrderDtl;
var ttInvcDtl_results = (from ttInvcDtl_Row in ttInvcDtl
where (ttInvcDtl_Row.RowMod == “U”) select ttInvcDtl_Row);
foreach (var ttInvcDtl_xRow in ttInvcDtl_results)
{
var Company = ttInvcDtl_xRow.Company;
var OrderNum = ttInvcDtl_xRow.OrderNum;
var OrderLine = ttInvcDtl_xRow.OrderLine;
var OrderDtl_row = (from ttOrderDtl_Row in Db.OrderDtl
where (ttOrderDtl_Row.Company == Company) select ttOrderDtl_Row).FirstOrDefault();
//Issue finding custom fields?
ttInvcDtl.RCTrkQty_c = OrderDtl_row.RCTrkTtlQty_c;
ttInvcDtl.AveragePerRCTrk_c = OrderDtl_row.AvgPrice_c;
}
Errors:
I keep going back to declaring ttInvcDtl. I am new to C# and getting help from our programmer so I need some more guidance.
theRowHere.UDField<TheTypeHere>("FieldNameHere");
//using my code above as a reference
i.UDField<decimal>("SKTotalQty_c") = myOrder.UDField<decimal>("TotalQtyUnit_c");