NetSuite:Company CAD Invoice form and Company Inc Invoice form -
can me in below issue having please: can done through workflow rule, if yes how? appreciate help. thanks
company cad invoice form , company inc invoice form - want use company cad invoice form when invoicing customer in canada subsidiary , company inc invoice form when invoice customer in company inc subsidiary. right cad invoice linked employee role labeled "company - senior accountant," causes issues when assigned role needs invoice company inc
yes possible. there several ways this, however, via client side script pageinit , postsourcing script.
if choose invoice customer record, hit pageinit script. if create invoice scratch, after enter customer, hit postsourcing script.
script should:
- check subsidiary
- check current form
- if form subsidiary isn't correct
- change form correct form.
see code below. hope helps. might few bugs iron out, should gist.
function pageinit(type){ var customer = nlapigetfieldvalue('entity'); if(customer!='' && customer!=null){ // check if customer populated first var subsidiary = nlapigetfieldvalue('subsidiary'); // subsidiary var form = nlapigetfieldvalue('customform'); // form if(subsidiary == xx && form != yy){ // compare subsid id form id - change xx , yy appropriately nlapisetfieldvalue('customform', yy) // set correct form. } // add other if statements here } } function onpostsourcing(type, name) { if(name=='entity'){ // if customer changed if(customer!='' && customer!=null){ // make sure user hasn't set customer empty var subsidiary = nlapigetfieldvalue('subsidiary'); // subsidiary var form = nlapigetfieldvalue('customform'); // form if(subsidiary == xx && form != yy){ // compare subsid id form id - change xx , yy appropriately nlapisetfieldvalue('customform', yy) // set correct form. } // add other if statements here } }
}
Comments
Post a Comment