Discussions
Automatically Change Opportunity Status when Quote Status is Changed
I need to have the related opportunity's entity status change automatically when the related quote's status changes. I was told by NetSuite support that this is not possible via a workflow. I do have SuiteScript file that accomplishes this, but I need to limit this to only specific statuses and by sale type, which we have as a custom field.
Here is the SuiteScript file I have so far:
function userEventAfterSubmit(type)
{
var id = nlapiGetRecordId();
var record = nlapiLoadRecord('estimate',id);
var status = record.getFieldValue('entitystatus');
nlapiLogExecution('DEBUG', 'Estimate Status - CODE', status);
var opportunity = record.getFieldValue('opportunity');
nlapiLogExecution('DEBUG', 'Opportunity ID', opportunity);