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.
New AI Community Guidelines. Please review and follow them to ensure AI use stays safe, accurate, and compliant.
Update: Narrative Insights has been restored and is now available.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Narrative Insights is Temporarily Unavailable due to an Infrastructure Issue. Learn how This Impacts Your Account and What to Expect While the Feature is Disabled.
Why is this client script not logging anything?
Hi
I have the following client script which i would expect would trigger when the vendor name or subsidiary is changed on a vendor bill record (which is where it is deployed). Can you see what is wrong with the script? This isn't returning an error though isn't logging anything with console.log (deleted) or log.debug(current version of script)
/** @NApiVersion 2.x@NScriptType ClientScript
*/
define(['N/search', 'N/record', 'N/log'], function(search, record, log) {function fieldChanged(context) {
var currentRecord = context.currentRecord; var fieldId = context.fieldId; // Logging the current record and the field ID log.debug('Current Record', JSON.stringify(currentRecord)); log.debug('Field ID', fieldId); // Trigger the search when the vendor or subsidiary field changes if (fieldId === 'entity' || fieldId === 'subsidiary') { var vendorName = currentRecord.getText('entity'); // Get vendor name var subsidiaryName = currentRecord.getText('subsidiary'); // Get subsidiary name log.debug('Vendor Name', vendorName); log.debug('Subsidiary Name', subsidiaryName); if (vendorName && subsidiaryName) { //
0