Sunday, September 16, 2018

Find out via Suitescript if a Transaction or Entity came from Web Store

Here are sample scripts that can accomplish this. User can opt to deploy it as user-event script and use nlapiGetNewRecord() API instead to get the instance of nlobjRecord.
 
 
FOR ENTITY: 

var rec = nlapiLoadRecord('customer',392);
var wlead = rec.getFieldValue('weblead');
nlapiLogExecution('DEBUG','wlead',wlead);

To check if the value returned is correct:
Navigate to Lists > Relationships > Customer > View Customer record > Marketing tab> Web Lead field
- This field is not editable in the User Interface and returns Yes if this lead, prospect, or customer record was created as a result of registering through the Web site.


FOR TRANSACTION:

var rec = nlapiLoadRecord('salesorder',1942);
var source = rec.getFieldValue('source');
nlapiLogExecution('DEBUG','source',source);
 

No comments:

Post a Comment