This topic contains 2 replies, has 0 voices, and was last updated by darrenhillconsulting 6 years, 8 months ago.
-
AuthorPosts
-
March 15, 2018 at 1:47 pm #18008
david.lyleCode:
createdInvoice = nlapiCreateRecord(‘invoice’);
createdInvoice.setFieldValue(‘entity’, 1233);
createdInvoice.selectNewLineItem(‘item’);
createdInvoice.setCurrentLineItemValue(‘item’, ‘item’, “ITEM”);
createdInvoice.setCurrentLineItemValue(‘item’, ‘quantity’, 4);
createdInvoice.setCurrentLineItemValue(‘item’, ‘rate’, 24 );
createdInvoice.setCurrentLineItemValue(‘item’, ‘custcol_list_rate’, 24);
createdInvoice.setCurrentLineItemValue(‘item’, ‘amount’, 24);
createdInvoice.setCurrentLineItemValue(‘item’, ‘description’, “description”);
createdInvoice.commitLineItem(‘item’);
I’m fairly new to NetSuite and I’m just trying to create an invoice in my sandbox account. My customer’s ID is 1233. After running this script through my browser’s javascript console I don’t see the invoice nor the item/transaction tied to it. Maybe I’m fundamentally misunderstanding something about invoices? Thank you,
This is a cached copy. Click here to see the original post. -
March 15, 2018 at 2:04 pm #18009
MikeBucklaewYou haven’t saved the invoice. After your commit line item line you’ll need this:
Code:
var newInvoiceId = nlapiSubmitRecord(createdInvoice);
Your code will then create a stand alone invoice if all the mandatory fields have values. You may want to invoice a sales order. In order for the invoice to be linked to the sales order you’ll want to look at nlapiTransformRecord().
david.lyle replied on 03/15/2018, 02:34 PM: Perfect, thank you.
-
March 15, 2018 at 2:05 pm #18010
darrenhillconsultingIf you’re just starting out … why not use SS 2.0?
david.lyle replied on 03/15/2018, 02:24 PM: I thought I was..but I’m just realizing that I’m not thanks to your comment. I guess 1.0 is more widely documented online than 2.0 is, whenever I search for help I’m always seeing things like “nlapiLoadRecord” and “nlapiCreateRecord”.
I’m just trying to create an invoice record and there seems to be a wealth of information related to nlapiCreateRecord. What is the equivalent of “nlapiCreateRecord(‘invoice’);” in 2.0?
I am reading that the 2.0 equivalent is “r.create()”…but r isn’t instantiated to any object?
-
AuthorPosts
You must be logged in to reply to this topic.