Hi,
I am trying to create sales orders for a customer. I receive an error that the customer credit limit has been reached.
I am using the API to create transactions. When creating a customer, how do I tell GP that the customer has an unlimited credit? Here is my code:
static void CreateCustomer()
{
CompanyKey companyKey;
Context context;
Customer customer;
CustomerKey customerKey;
Policy customerPolicy;
// Create an instance of the service
DynamicsGP wsDynamicsGP = new DynamicsGP();
// Be sure that default credentials are being used
wsDynamicsGP.UseDefaultCredentials = true;
// Create a context with which to call the service
context = new Context();
// Specify which company to use (sample company)
companyKey = new CompanyKey();
companyKey.Id = (-1);
// Set up the context
context.OrganizationKey = (OrganizationKey)companyKey;
// Create a new customer object
customer = new Customer();
// Create a customer key
customerKey = new CustomerKey();
customerKey.Id = "ADMINISTRATORGL";
customer.Key = customerKey;
//assign unlimited class
CustomerCreditLimit cc = new CustomerCreditLimit();
cc.Item = //what do I put into item?
cc.Period = 10;
cc.PeriodAmount = new MoneyAmount { Currency = "USD", DecimalDigits = 4, Value = 20000 };
customer.ClassKey = new CustomerClassKey { Id = "USA-ILMO-T1" };
// Set properties for the new customer
customer.Name = "Global Admin";
// Get the create policy for the customer
customerPolicy = wsDynamicsGP.GetPolicyByOperation("CreateCustomer", context);
// Create the customer
wsDynamicsGP.CreateCustomer(customer, context, customerPolicy);
}
*This post is locked for comments
Stay up to date on forum activity by subscribing. You can also customize your in-app and email Notification settings across all subscriptions.
André Arnaud de Cal... 291,240 Super User 2024 Season 2
Martin Dráb 230,149 Most Valuable Professional
nmaenpaa 101,156