venkatiyer1
Giga Guru

Recently, I was working on Change Form wherein I had to save the form if the user where to choose Yes in a select box and the form was modified. But the form modification would involve even the select box change. So there were two choices, one was to reset the value of the select box to original value and then check for g_form.modified which would be true only if any other field was modified. Alternatively, you can use the below script in your onChange function. The FIELDNAME would ideally be the name of the field and that typically is tablename.fieldName.

Using the below script you can skip the form modification feature for this field alone. Hope it help and any other suggestions are welcome.

g_form.fieldChanged("FIELDNAME", false);

Comments
mofostraub
Giga Contributor

This was extremely helpful, saving a great deal of time and headache. Thank you for taking the time to share this Venkat.


matclout2015
Tera Contributor

It is not working in our case in Istanbul version,


In a UI action, i'm not able to skip it even if I try all this, from the console, g_form.modified is still TRUE and the mesasge is shown.



g_form.modified=false;


for(var i in g_form.modifiedFields) {


    g_form.fieldChanged(i, false);


    g_form.modifiedFields[i]=false;


}


modfied stay trye.png


venkatiyer1
Giga Guru

Hi Mathieu,



I tried in Jakarta and the above piece was working. Can you ensure whether in Istanbul, when you say g_form.modifiedFields you are getting an object with a key which is of the pattern tablename.fieldname?


g_form.modified is coming out to be false for me. Also i am in UI 16.


Gary10
Mega Explorer

@matclout2015

Where did you find documentation on  g_form.modifiedFields ? I cannot find any documentation on this.

 

Thanks.

venkatiyer1
Giga Guru

There is no documentation on g_form.modifiedFields. I noticed it in the source code. 

Version history
Last update:
‎06-25-2015 05:07 PM
Updated by: