Discussions
SuiteWorld is the largest annual gathering of the NetSuite community! It will be held in Las Vegas on October 6-9, 2025. Our customers and partners look forward to SuiteWorld every year as a place to hear the latest from NetSuite, get hands-on learning, and connect with each other. Register now!
Script having problems with negative value ID
Hi,
I have written a script that automatically creates a calendar event from an opportunity record. The script creates an event for the first sales meeting on the opportunity.
The script is:
//get info from record that i need
var recordCreated = nlapiCreateRecord('calendarevent');
var user = nlapiGetUser();
var apptdate = nlapiGetFieldValue('custbody_apptdate');
var entity = nlapiGetFieldValue('entity');
var appttime = nlapiGetFieldValue('custbody_appttime');
var apptendtime = nlapiGetFieldValue('custbody_apptendtime');
var srep = nlapiGetFieldValue('salesrep');
//set field values on new calendar event
recordCreated.setFieldValue('title', 'Lead');
recordCreated.setFieldValue('startdate', apptdate);
recordCreated.setFieldValue('accesslevel', 'PUBLIC');
recordCreated.setFieldValue('customform', 18);
recordCreated.setFieldValue('organizer', user);
recordCreated.setFieldValue('timedevent', 'T');
recordCreated.setFieldValue('company', entity);