Hi Epiusers community,
I’m following the following method to add a UD field to the Time Phase grid by repurposing an unused column and adjusting it with a post-processing directive, which seems like the easiest method for my first-time custom code work with limited C# knowledge.
Add UD fields from other BO in grid - #16 by Christian_Pouchoulen
However, I am getting the error messages
The name ‘DB’ does not exist in the current context
The name ‘ttTimePhas’ does not exist in the current context
Below are my codes
foreach (var ttTimePs in (from row in ttTimePhas select row))
{
var dbJobName = (from row in DB.JobHead
where row.Company == Session.CompanyID &&
row.JobNum == ttTimePs.JobNum
select row).FirstOrDefault();
if (dbJobName != null)
{
// Set the value of ttTimePs.PrintMe to the JobName_c field from JobHead
ttTimePs.PrintMe = dbJobName.JobName_c;
}
else
{
// Handle the case where there is no matching JobHead record
ttTimePs.PrintMe = "";
}
}
Need some guidance here. Thank you in advance.