Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics GP (Archived)

Customer Credit Limit Has Been Exceeded

(0) ShareShare
ReportReport
Posted on by 585

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

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > 🔒一 Microsoft Dynamics GP (Archived)

#1
Almas Mahfooz Profile Picture

Almas Mahfooz 3 User Group Leader

Featured topics

Product updates

Dynamics 365 release plans