F7类型的字段一定要先给FND、DSP赋值,后面再给FLD赋值。下面的代码发给您做备忘用!
1、如果是循环给单据体的F7字段赋值,可以参考如下代码:
for (int i = 0; i < dtPhase.Rows.Count; i++)
{
DataRow dr = m_BillInterface.Data.Tables["Page3"].Rows.Add();
dr["FSalePhaseID_FNDName"] = dtPhase.Rows[i]["FNumber"].ToString();
dr["FSalePhaseID_DSPName"] = dtPhase.Rows[i]["FName"].ToString();
dr["FSalePhaseID"] = int.Parse(dtPhase.Rows[i]["FID"].ToString());
}
2、如果是直接用m_BillInterface.SetFieldValue给F7类型的赋值,则可以参考
m_BillInterface.SetFieldValue("FCustID", Convert.ToString(dtOPP.Rows[0]["FCustNumber"]), Enu_ValueType.FFND);
m_BillInterface.SetFieldValue("FCustID", Convert.ToString(dtOPP.Rows[0]["FCustName"]), Enu_ValueType.FDSP);
m_BillInterface.SetFieldValue("FCustID", Convert.ToInt32(dtOPP.Rows[0]["FCustomerID"]), -1, Enu_ValueType.FFLD);