添加Acumatica客户联系人

时间:2015-06-16 09:02:55

标签: web-services acumatica

我在使用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);

1 个答案:

答案 0 :(得分:0)

希望您使用的是屏幕ID的AR303000和CR302000,

  • 添加操作命令"添加联系人"在客户架构中 并提交
  • 您可以使用屏幕CR302000和设置ContactID并提交 首先将所有信息(如果存在)加载到架构
  • 稍后您将添加用于更新所需值的命令,并提交 使用保存命令
相关问题