Hi,
I am trying to create a Sales Order using the Web Service API. I receive an error about a phone number:
Cannot insert the value null into column Print_Phone_NumberGB table Two.db.SOP10200
This field appears to be in the customer address table. Where is this field and how do I fill it in? Here is my code:
public CustomerAddressKey CreateCustomerAddress(CustomerKey customerK)
{
CustomerAddressKey customerAddressKey;
CustomerAddress customerAddress;
// Create a customer key to specify the customer
//customerKey = new CustomerKey();
//customerKey.Id = "AARONFIT0001";
// Create a customer address key
customerAddressKey = new CustomerAddressKey();
customerAddressKey.CustomerKey = customerK;
customerAddressKey.Id = "BILLING";
// Create a customer address object
customerAddress = new CustomerAddress();
customerAddress.Key = customerAddressKey;
// Populate properties with address information
customerAddress.Line1 = "11403 45 St. South";
customerAddress.Line2 = "Billing Dept.";
customerAddress.City = "Chicago";
customerAddress.State = "IL";
customerAddress.PostalCode = "02452";
customerAddress.CountryRegion = "USA";
customerAddress.Phone1 = new PhoneNumber { CountryCode = "1", Extension = "781", Value = "1234567" };
// Get the create policy for the customer address
// Create the customer address
wsDynamicsGP.CreateCustomerAddress(customerAddress, context, createCustomerAddress);
return customerAddress.Key;
// Close the service
//if (wsDynamicsGP.State != CommunicationState.Faulted)
//{
// wsDynamicsGP.Close();
//}
}
*This post is locked for comments