我正在尝试在 MS Dynamics GP 中创建客户。这是我的代码:
public void CreateGPCustomer(JMAOrder jd)
{
Customer cu = new Customer();
cu.ModifiedDate = DateTime.Now;
cu.IsActive = true;
cu.Name = "Joseph Jones";
cu.Shortname = "Joe";
cu.StatementName = cu.Name;
CustomerAddress cad = new CustomerAddress();
cad.City = "Waltham";
cad.ContactPerson = cu.Name;
cad.CountryRegion = "US";
cad.CreatedDate = DateTime.Now;
cad.LastModifiedDate = DateTime.Now;
cad.Line1 = "123 Main St";
cad.Line2 = "12";
PhoneNumber ph = new PhoneNumber();
ph.CountryCode = "1";
ph.Value = "7811234567";
cad.Phone1 = ph;
cad.PostalCode = "02452";
cad.State = "MA";
cu.Key = MakeCustomerKey("Joseph", "Jones");
Policy p = wsDynamicsGP.GetPolicyByOperation("CreateCustomer", context);
wsDynamicsGP.CreateCustomer(cu, context, p);
}
我看到没有添加地址:
我缺少什么代码?