我在使用Web服务添加客户联系人时遇到问题,在第一次集成时,我的应用程序使用Web服务成功添加了联系人。但是当我在同一个客户中重新集成同一个联系人时,它会复制以前集成的联系人,而不仅仅是更新它们。我尝试将值添加到ContactID字段,但它给出了转换失败的错误,从字符串转换为int。
AR303000Content custSchema = context.AR303000GetSchema();
var commands = new Acumatica_LSOne_Integration.ARMODULE.Command[]
{
new Acumatica_LSOne_Integration.ARMODULE.Value
{
Value = RecID.Replace("-"," ").Trim(),
LinkedCommand = custSchema.CustomerSummary.CustomerID
},
custSchema.Actions.NewContact
};
context.AR303000Submit(commands);
CR302000Content contSchema = context.CR302000GetSchema();
commands = new Acumatica_LSOne_Integration.ARMODULE.Command[]
{
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("CONTACTNAME")).Trim(), LinkedCommand = contSchema.DetailsSummary.LastName},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("STREET")).Trim(), LinkedCommand = contSchema.DetailsAddress.AddressLine1},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("ADDRESS")).Trim(), LinkedCommand = contSchema.DetailsAddress.AddressLine2},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("CITY")).Trim(), LinkedCommand = contSchema.DetailsAddress.City},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("COUNTRY")).Trim(), LinkedCommand = contSchema.DetailsAddress.Country},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("ZIPCODE")).Trim(), LinkedCommand = contSchema.DetailsAddress.PostalCode},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("EMAIL")).Trim(), LinkedCommand = contSchema.DetailsContact.Email},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("PHONE")).Trim(), LinkedCommand = contSchema.DetailsContact.Phone1},
new Acumatica_LSOne_Integration.ARMODULE.Value {Value = reader1.GetString(reader1.GetOrdinal("CELLULARPHONE")).Trim(), LinkedCommand = contSchema.DetailsContact.Phone2},
contSchema.Actions.Save,
};
context.CR302000Submit(commands);
答案 0 :(得分:0)
希望您使用的是屏幕ID的AR303000和CR302000,