1
如何使用套件腳本API獲取交易類型?基於取得的值想要執行邏輯。是否有可能獲取交易類型?NetSuite - 使用套件腳本獲取交易類型API
function afterSubmit(type) {
if (type == 'create' || type == 'edit') {
//how to get transaction type(transType) so that I can use in the condition???
if (transType == 'SalesOrd') {
var toemail = nlapiLookupField('customer',
nlapiGetFieldValue('customer'), 'email');
nlapiLogExecution('DEBUG', 'ToEmail', toemail);
var emailSubject = 'Hello World';
var emailBody = 'Hello World Message';
var fromId = -5;
nlapiSendEmail(fromId, toemail,
emailSubject, emailBody, null, null, null, null);
}// if
else
if (transType == PurchOrd) {
var toemail = nlapiLookupField('customer',
nlapiGetFieldValue('customer'), 'email');
nlapiLogExecution('DEBUG', 'ToEmail', toemail);
var emailSubject = 'Hello World';
var emailBody = 'Hello World Message';
var fromId = -5;
nlapiSendEmail(fromId, toemail,
emailSubject, emailBody, null, null, null, null);
}
}// end
}
-Thanks