Unable to set the PRICE LEVEL field to “CUSTOM” in lines of Invoices, generated through suitescript

84 views Asked by At

Trying to create invoice record from afterSubmit of a custom record.

The invoice record gets created successfully, but the PRICE LEVEL in lines are always set to BASE PRICE, though we need it CUSTOM.

When we try to set the PRICE LEVEL field to CUSTOM, while creating an invoice record, system gives a weird error and INVOICE doesnt get created. However, when we edit the generated invoice from UI and set the price level as CUSTOM, it sets successfully.

Is there anyway i can set the pricelevel to CUSTOM from script because we need it only in the invoice created through script, while for UI-created invoices it should be BASE PRICE.

    CODE: invRecord.setCurrentLineItemValue('item', 'price', '-1' || -1);
    While ERROR is always different
1

There are 1 answers

0
F.furq On

Share the error Here. There can be many reasons why the custom Price is not set on the line items. 1- Set the custom form while creating the record.

If that doesn't work. load the record again after invoice creation. and then set the custom price level again.