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:

  1. check subsidiary
  2. check current form
  3. if form subsidiary isn't correct
  4. 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

Popular posts from this blog

php - Wordpress website dashboard page or post editor content is not showing but front end data is showing properly -

How to get the ip address of VM and use it to configure SSH connection dynamically in Ansible -

javascript - Get parameter of GET request -