Hi,
I am trying to create a customer in ax by calling the aif document service named CustCustomerService. I can create a customer with name, customer group and address information, but it did not update email and phone number fields. It does not show any error message on this.
Please help me to solve this issue.
Here is my code i used to create a customer:
private static void createCustomer()
{
CustomerServiceClient client = new CustomerServiceClient();
CallContext context = new CallContext();
context.Company = "ceu";
AxdEntity_CustTable customer = new AxdEntity_CustTable();
AxdEntity_DirPartyPostalAddressView postalAddress = new AxdEntity_DirPartyPostalAddressView();
postalAddress.Street = "123 Anystreet";
postalAddress.City = "Anytown";
postalAddress.State = "TX";
postalAddress.ZipCode = "79999";
postalAddress.CountryRegionId = "USA";
postalAddress.StreetNumber = "123";
postalAddress.RecIdSpecified = false;
postalAddress.Roles = "Invoice";
AxdEntity_DirParty_DirPerson dirParty = new AxdEntity_DirParty_DirPerson();
dirParty.DirPartyPostalAddressView = new AxdEntity_DirPartyPostalAddressView[] { postalAddress };
dirParty.PersonName = new AxdEntity_PersonName[] { new AxdEntity_PersonName() { FirstName = "MySecond", MiddleName = "Test", LastName = "Person" } };
AxdEntity_DirPartyContactInfoView emailInfo = new AxdEntity_DirPartyContactInfoView();
emailInfo.Type = AxdEnum_LogisticsElectronicAddressMethodType.Email;
emailInfo.Roles = "Invoice";
emailInfo.IsPrimary = AxdEnum_NoYes.No;
emailInfo.LocatorExtension = "";
emailInfo.LocationName = "Primary Email";
AxdEntity_DirPartyContactInfoView phoneInfo = new AxdEntity_DirPartyContactInfoView();
phoneInfo.Type = AxdEnum_LogisticsElectronicAddressMethodType.Phone;
phoneInfo.Roles = "Invoice";
phoneInfo.Locator = "800-867-5309";
phoneInfo.IsPrimary = AxdEnum_NoYes.Yes;
phoneInfo.LocatorExtension = "456";
phoneInfo.LocationName = "Primary Phone";
dirParty.DirPartyContactInfoView = new AxdEntity_DirPartyContactInfoView[] { emailInfo, phoneInfo };
customer.DirParty = new AxdEntity_DirParty_DirPerson[] { dirParty };
customer.action = AxdEnum_AxdEntityAction.create;
customer.SuppItemGroupId = "Retail";
customer.CustGroup = "Retail";
customer.LineDisc = "Retail";
AxdEntity_CustTable[] cust = new AxdEntity_CustTable[] { customer };
AxdCustomer c = new AxdCustomer() { CustTable = cust };
EntityKey[] keys = client.create(context, c);
foreach (EntityKey key in keys)
{
Console.WriteLine("New Customer completed.... Field = " + key.KeyData[0].Field + "; Value = " + key.KeyData[0].Value);
}
}