Search code examples
netsuitesuitescriptsuitetalk

How can bypass the credit limit while creating invoice or saleorder in Netsuite using SuiteTalk Webservice?


I am using Netsuite SuiteTalk web service since 3-4 months I felt comfortable to use it. now, i have issues i want to create saleorder/invoice in netsuite using SuiteTalk but i am unable to do that because everytime i am getting error of credit limit i.e customer invoice amount is more than their credit limit. it's O.K, but as long as i am sending payments too with the same webservice request.

I would appreciate if someone or Netsuite people can help me to bypass credit limit while creating invoice.

please have a look suitetalk c# code.

    Invoice inv = new Invoice();
    inv.entity = new RecordRef() { internalId = 25, type = RecordType.customer, typeSpecified = true };
    inv.tranDate = new DateTime(2018,9,18);
    inv.memo = "Test Memo";

    inv.department = new RecordRef() { internalId = 10, type = RecordType.department, typeSpecified = true };
    inv.location = new RecordRef() { internalId = 16, type = RecordType.location, typeSpecified = true };


     InvoiceItemList itemList = new InvoiceItemList();

     InvoiceItem[] items = new InvoiceItem[1];

     // invoice items
     InvoiceItem item = new InvoiceItem();
     item.item = new RecordRef() { internalId = 12510 };
     item.rate = 2.65;
     item.amount = 265.00;                    
     item.quantity = 100;

     items[0] = item;                

     itemList.item = items;
     inv.itemList = itemList;


     inv.amountPaid = 180;
     inv.amountPaidSpecified = true;

     inv.onCreditHold = "true";

     WriteResponse writeRes = ns.Service.add(inv);

Solution

  • I have found the best solution, in order to avoid credit limit while creating invoice we can create Payment as PaymentItem and then we need to add in invoice.