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