I have spend almost all the day looking alternatives:
I created a Customized Field in the Employee table (EmpBasic).
When the user is created, we need to add a record in the Warehouse Bin table (WhseBin) for an specific warehouse created for employees. To do it, I am trying to create a BPM in Employee.Update.
I have the next code:
bool bExists = false;
string sTOOLSEMP = "TOOLSEMP";
using (var txscope = IceDataContext.CreateDefaultTransactionScope())
{
foreach(var ttEmpBasic_iterator in(from ttEmpBasic_Row in ttEmpBasic select ttEmpBasic_Row))
{
var ttEB = ttEmpBasic_iterator;
foreach (var tWhseBin in Db.WhseBin.Where( tWhseBin => tWhseBin.Company == Session.CompanyID && tWhseBin.WarehouseCode == sTOOLSEMP && xWhseBin.BinNum == ttEB.ClockNo_c))
{
bExists = true;
xWhseBin.ZoneID = ttEB.WhseZone_c;
}
if (!bExists)
{
// Add row
WhseBin newRow = new WhseBin();
Db.WhseBin.Insert(newRow);
newRow.Company = Session.CompanyID;
newRow.WarehouseCode = sTOOLSEMP ;
newRow.EmpID_c = ttEB.EmpID;
newRow.BinNum = ttEB.ClockNo_c;
newRow.Description = ttEB.Name;
newRow.ZoneID = ttEB.WhseZone_c;
}
}
Db.Validate();
txscope.Complete();
}
I receive the error:
1.
"EmpBasicRow" doe snot contain a definition for ClockNo_c and no accesible extension method 'ClocKNo_c' accepting a first argument of type 'EmpBasicRow' could be found (are you missing a using directive or an assembly reference?)
2.
"EmpbasicRow" doe snot contain a definition for WhseZone_c and no accesible extension method 'WhseZone_c' accepting a first argument of type 'EmpBasicRow' could be found (are you missing a using directive or an assembly reference?)
Those two fields with the error are customized fields. I just entered Constants to test it and the record is saved, but the custom fields are not recognized.
This is weird because those fields are listed to be used in a Show Message and the values are displayed.
Thank you for your comments,