Create a Custom Entity Field
Customization > Lists, Records, & Fields > Transaction Body Fields >
Label: Related Sales OrderId: _txn
Type: Multiple Select
List/Record: Transaction
Applies To:
Project: checked
Display:
Subtab: Main
Display Type: Inline Text
Use the following Snippet on a Page Init Client Side Script
Customization > Scripting > Scripts > New > Client'
var filters = [];
filters.push(new nlobjSearchFilter('internalidnumber', 'job', 'equalto', nlapiGetRecordId()));
var columns = [];
columns.push(new nlobjSearchColumn('internalid'));
var searchResults = nlapiSearchRecord('salesorder', null, filters, columns);
var outputString = "";
for(var i = 0;i < searchResults.length;i++){
var searchResult = searchResults[i];
outputString += searchResult.getId() + String.fromCharCode("5");
}
nlapiSetFieldValue('custentity_txn', outputString);
filters.push(new nlobjSearchFilter('internalidnumber', 'job', 'equalto', nlapiGetRecordId()));
var columns = [];
columns.push(new nlobjSearchColumn('internalid'));
var searchResults = nlapiSearchRecord('salesorder', null, filters, columns);
var outputString = "";
for(var i = 0;i < searchResults.length;i++){
var searchResult = searchResults[i];
outputString += searchResult.getId() + String.fromCharCode("5");
}
nlapiSetFieldValue('custentity_txn', outputString);
No comments:
Post a Comment