Duplicate Function issue in Netsuite?

Hi All,

I am not sure how many of you faced this issue but when this issue is very hard to debug if you are not aware of this. We develop scripts daily for different records, different function names but we don't remember what name we used last time.

 So when we create one function with name alert1 in example1.js and created one script for this file
function alert1()
{
  alert('this is alert from script 1');
}

and we create one more function with same name in different file example2.js and created one more script.
function alert1()
{
  alert('this is alert from script 2');
}

Now question is which function will execute first , or which function will not execute or when and which function will execute ?
Result Below:



Ideally if you did not changed sequence from scripted record then newest file's function will be executed and old function will be override by same function's code of new file/script.

Same issue might comes when your function name is same as some function name from another script. If you have installed any bundle and that bundle have file with same name on same record.

So while adding new function, donot forgot to use new name for function.
Let me know if you have any question or suggestion.


Thanks
Abhishek


Download Netsuite Guru Android App
Follow Me on Linkedin
Our FB Page

Comments