Page 1 of 1

function nuOnLoad() runs twice, onLoad and when saving

Posted: Tue Nov 08, 2022 11:17 am
by yvesf
Hello,

I have put a function nuOnLoad() behind a form. I am surprised that this function is running when loading the form but also when saving. If anyone could explain me how this function works, it would be nice.
Code behind the function nuOnLoad()

Code: Select all

function nuOnLoad(){
  

   if ((nuFormType() == 'edit') {
                let oldlbl=nuGetValue('tsk_label');
                 console.log('oldlbl in nuOnLoad : ' + oldlbl);
               

   }
}
and the trace in the console log prove that it traces when loading but also on saving. I would be interested to capture the value before saving. How can I do that ?
Thanks Yves

Re: function nuOnLoad() runs twice, onLoad and when saving

Posted: Tue Nov 08, 2022 11:20 am
by kev1n
nuOnLoad() should only be used under Setup -> Header, but not in a form.