error:customer cannot be created

hi all,

i am trying to create a customer,but unable to do it.

the following is the code:

CustomerServiceClient proxy = new CustomerServiceClient();
CallContext context = new CallContext();
context.Company = “ceu”;

AxdCustomer customer = new AxdCustomer();

AxdEntity_CustTable custTable = new AxdEntity_CustTable();
custTable.AccountNum = “998877”;
custTable.Currency = “USD”;
custTable.CustGroup = “20”;
custTable.OneTimeCustomer = AxdExtType_OneTimeCustomer.Yes;
custTable.OneTimeCustomerSpecified = true;

//Create the party record
AxdEntity_DirParty_DirPerson party = new AxdEntity_DirParty_DirPerson();
party.NameAlias = “Becky”;

//Set the name fields
AxdEntity_PersonName personName = new AxdEntity_PersonName();
personName.FirstName = “Becky”;
personName.MiddleName = “ILiveForThis”;
personName.LastName = “Newell”;

//Add the names to the party record and set the name sequence
party.PersonName = new AxdEntity_PersonName[1] { personName };
party.NameSequence = “FirstLast”;

//Create a postal address
AxdEntity_DirPartyPostalAddressView address = new AxdEntity_DirPartyPostalAddressView();
address.LocationName = “Location Name”;
address.Street = “2122 NE 5th St”;
address.City = “Beverly Hills”;
address.State = “CA”;
address.CountryRegionId = “USA”;
address.ZipCode = “90210”;
address.Roles = “Home;Delivery”;

//Create an electronic address
AxdEntity_DirPartyContactInfoView electronicAddress = new AxdEntity_DirPartyContactInfoView();
electronicAddress.LocationName = “Contact Email”;
electronicAddress.Type = AxdEnum_LogisticsElectronicAddressMethodType.Email;
electronicAddress.TypeSpecified = true;
electronicAddress.Locator = “”;
electronicAddress.Roles = “Home”;

//Add the addresses to the party record and the party to the CustTable record
custTable.DirParty = new AxdEntity_DirParty_DirPartyTable[1] { party };
custTable.DirParty[0].DirPartyPostalAddressView = new AxdEntity_DirPartyPostalAddressView[1] { address };
custTable.DirParty[0].DirPartyContactInfoView = new AxdEntity_DirPartyContactInfoView[1] { electronicAddress };

//Add the CustTable record to the Customer entity
customer.CustTable = new AxdEntity_CustTable[1] { custTable };

//Create the customer
proxy.create(context, customer);

“customer cannot be created” error is what i am getting.

request you to please help me on this.


Try entering any other data in Account Number instead of 998877. May be the customer already exist in system.