我在使用 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);
希望您使用的是屏幕ID的AR303000和CR302000,
- 在
- 客户架构中添加操作"添加联系人"的命令后并提交
- 您可以使用屏幕CR302000并设置联系人ID并提交首先将所有信息(如果存在)加载到架构
- 稍后添加用于更新所需值的命令并提交使用保存命令。