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
Line Init function
Hi,
I'm trying to set default value for Location in the line items using the script below. During testing I noticed that the function didn't fire before the first line item is added to the the sublist. Instead it fired after the 'Add' button is clicked. However, this function worked for the succeeding line items.
Is this how Line Init function behaves?
function lineInit(type) { //get value of Location line item field var lineLocationValue = nlapiGetCurrentLineItemValue(type, 'location'); //check if location in the line item has a value, if not default to the //value of location (main tab). if (lineLocationValue == null || lineLocationValue == '') { var locationValue = nlapiGetFieldValue('location'); if (locationValue != null || locationValue != '') { nlapiSetCurrentLineItemValue(type, 'location', locationValue, false, false); } } } 0