Hi,
I am trying to update a Suitelet sublist fields using a button and client-side script. Is this possible? My script simply clears the field. Does the sublist have to be of a certain type e.g. inlineeditor?
The idea...
Create a select field with a source to a custom record and a button that when pressed it will up take the value of the select field and update a column (every row) on my sublist to that value.
What I have so far...
function suitlet(objRequest,objResponse){ var objForm = nlapiCreateForm('Migrate Sales Order Lines'); // Create Form objForm.setScript('customscript_contract_migration_so_cs'); //same script file // add Sublists var slSO = objForm.addSubList('sl_trans', 'list', 'Sales Order Lines'); slSO.addField('custpage_checkbox', 'checkbox','Select'); slSO.addField('custpage_id', 'text', 'ID') slSO.addField('custpage_num', 'text', 'Number') slSO.addField('custpage_so', 'text', 'Sales Order'); slSO.addField('custpage_customer', 'text', 'Customer'); slSO.addField('custpage_amount', 'currency', 'Amount'); slSO.addField('custpage_startdate', 'text', 'Start Date'); slSO.addField('custpage_bo', 'text', 'Billing Option'); slSO.addField('custpage_bo_new', 'select', 'Migration Billing Option','customrecord_billing_options'); // <-- this is the field I want to update via button and field selection //SEARCH blah blah (skipped to avoid boredom) for(var i=0;i<arrTransResults.length;i++){ slSO.setLineItemValue('custpage_radio', i+1, stSelectRadio); slSO.setLineItemValue('custpage_id', i+1, arrTransResults[i].getId()); slSO.setLineItemValue('custpage_num', i+1, arrTransResults[i].getValue('number')); slSO.setLineItemValue('custpage_so', i+1, 'Sales Order #' + arrTransResults[i].getValue('number')); slSO.setLineItemValue('custpage_line', i+1, arrTransResults[i].getId() + '_' + arrTransResults[i].getValue('line')); slSO.setLineItemValue('custpage_supplier', i+1, arrTransResults[i].getValue('custcol1')); slSO.setLineItemValue('custpage_amount', i+1, arrTransResults[i].getValue('amount')); slSO.setLineItemValue('custpage_customer', i+1, arrTransResults[i].getText('entity')); slSO.setLineItemValue('custpage_startdate', i+1, arrTransResults[i].getValue('startdate')); slSO.setLineItemValue('custpage_renewaldate', i+1, arrTransResults[i].getValue('custcol_renewal_date')); slSO.setLineItemValue('custpage_bo', i+1, arrTransResults[i].getText('custcol_billing_options')); slSO.setLineItemValue('custpage_bo_new', i+1, arrTransResults[i].getValue('custcol_billing_options')); } var fldMigBO = objForm.addField('custpage_migr_bo','select','Migration Billing Option','customrecord_billing_options'); //my select for update objForm.addButton('custpage_btn_apply_bo', 'Apply Billing Option', 'btnActionApplyBO'); //my button to initiate sublist update based on field above response.writePage(objForm); } //my client-side button function btnActionApplyBO(){ for(var i=1;i<=nlapiGetLineItemCount('sl_trans'); i++){ alert(nlapiGetFieldValue('custpage_migr_bo')) nlapiSetLineItemValue('sl_trans','custpage_bo_new',i,nlapiGetFieldValue('custpage_migr_bo')); } } Any help would be greatly appreciated!Cheers,Tristan