I think I found a solution using a simplified version of the code and it compile no-errors. I tested the BPM and it works!
Erp.Tables.COMXref COMXref;
foreach (var ttporel_xRow in ttporel)
{
var ttporelRow = ttporel_xRow;
COMXref = new Erp.Tables.COMXref();
Db.COMXref.Insert(COMXref);
COMXref.Company = "CQE";
COMXref.File = "PORel_Mapping";
COMXref.Key1 = System.Convert.ToString(ttporelRow.PONum);
COMXref.Key2 = System.Convert.ToString(ttporelRow.POLine);
COMXref.Key3 = System.Convert.ToString(ttporelRow.PORelNum);
COMXref.foreignKey1 = "No";
COMXref.foreignKey2 = "Yes";
}
Thank you all for your replies.
Daniel Dell'Aquila