Discussions
Stay up-to-date with the latest news from NetSuite. You’ll be in the know about how to connect with peers and take your business to new heights at our virtual, in-person, on demand events, and much more.
Now is the time to ask your NetSuite-savvy friends and colleagues to join the NetSuite Support Community! Refer now! Click here to watch and learn more!
Stay in the Know
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Be sure you're subscribed to NetSuite communication to stay in the know about monthly happenings, updates and announcements. Subscribe
Please note that on Friday, March 20, 2026, at 8:00 PM Pacific time, our Case Management System will undergo a scheduled maintenance for approximately 4 hours. During this time, case creation via SuiteAnswers will be unavailable and inbound calls will be routed to Customer Service.
Creating Quote from Project Record Script
I'm trying to create a quote via a script from a project record. The project record contains all the information I need to create the quote, but for some reason when I use a client side script to create the quote - I get the following error message:
An unexpected error occurred in a script running on this page.
createChangeOrderButton (button)
customscript_g5_cs_project
INVALID_CUSTOMER_RCRD
This customer record -1 is not valid. Please create the customer first.
I've created a client side button with the following code:
function createChangeOrderButton(){ var projectId = nlapiGetRecordId(); var customer = nlapiGetFieldValue('parent'); //create quote var recQuote = nlapiCreateRecord('estimate'); var recQuoteId = recQuote.getId(); nlapiSetFieldValue('custbody_reseller',3415); nlapiSetFieldValue('custbody_distributor',3414); nlapiSetFieldValue('custbody_end_user',13814); nlapiSetFieldText('custbody_order_type','Contract - New'); nlapiSetFieldValue('custbody_bill_to_tier',1); nlapiSetFieldValue('custbody_ship_to_tier',1); nlapiSetFieldText('probability','60%'); nlapiSetFieldValue('entity',3415); recQuote.selectNewLineItem('item'); recQuote.setCurrentLineItemValue('item', 'item', 24); recQuote.setCurrentLineItemValue('item', 'project', projectId); recQuote.commitLineItem('item'); var reqQuoteId = nlapiSubmitRecord(recQuote, false, true); var quoteURL = nlapiResolveURL('RECORD', 'estimate', recQuoteId, true); window.open(quoteURL, '_blank'); } 0