Hello all,
I am trying to develop a script that will get a field value to populate based on the total of values on a search/sublist.
Here is the scenario -
A custom field called "Committed Amount" exists on Custom Record A.
On a Custom Record B which is a child of Custom Record A, another custom field called "Amount" exists. Multiple Custom Records B will be created against Custom Record A. Intention is to total up the Amount fields for all child B records and insert that value in the field provided in A (Committed Amount).
A search is created (called "CR B Sublist") that has the "Sublist" view checked and "Show Totals" checked. The results show the total of the "Amount" field for all B records associated with A (for example 35,000).
This search shows up as a sublist on Custom Record A.
How can I get the total of the search/sublist "Amount" column (35,000) show on the custom field "Committed Amount" ?
This is what I have so far. Please note that I am not a programmer. This is clipping from an existing script changed to make some logical sense. Your help is appreciated.
function getComitAmt(request, response)
{
https://system.netsuite.com/app/common/search/searchresults.nl?searchid=73&whence=
var toResponse = '';
response.write('\nvar scents = []; \n');
var baseId = request.getParameter( 'baseId' );
var columns = new Array();
columns.push(new nlobjSearchColumn('Amount'));
var searchresults = nlapiSearchRecord('custrecord99', null, filters, columns);
for (var i=0; (searchresults != null && i < searchresults.length); i++)
response.write('custrecord99();');
}