I am having problem adding customer contacts using web services, at first instance of integration my application successfully adds the contacts using web services. But when i re-integrate the same contact in the same customer it duplicates the previously integrated contacts instead of just updating them. I tried adding value to the ContactID field but it gives me the error of convert failed from string to 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);
Hope you are using Screen ID's AR303000 and CR302000,