AnsweredAssumed Answered

ProcessOnChange Hidden Tab

Question asked by marek.kundera on Sep 13, 2016
Latest reply on Sep 13, 2016 by marek.kundera

Hoping to figure this out....


I have a Repeating Section that contains a Lookup Field ThreatsLP. When we export this to Excel, it comes out like this:

<?xml version="1.0" encoding="utf-8"?><RepeaterData><Version /><Items><Item><ThreatsLP type="System.String">2</ThreatsLP></Item><Item><ThreatsLP type="System.String">3</ThreatsLP></Item><Item><ThreatsLP type="System.String">5</ThreatsLP></Item><Item><ThreatsLP type="System.String">5</ThreatsLP></Item><Item><ThreatsLP type="System.String">7</ThreatsLP></Item><Item><ThreatsLP type="System.String">4</ThreatsLP></Item></Items></RepeaterData>
Obviously, this is pretty useless for doing work in Excel.
My workaround was to create a Calculated field on the form, with the function:


I connected the Calculated Field to a new Single Line Text column in my list. The end result is like this:



Nice! However, the Calculated field is cleared every time I open the form in Edit View. When I manually run ProcessOnChange(ThreatsLP), the calculated field is re-populated again:

NWF.FormFiller.Functions.ProcessOnChange(NWF$('div [data-controlname="ThreatsLP"] select').first());


However this only works if the repeating section is not hidden. If a different tab in the form is activated when running the above code, the calculated field does not populate. How do I get around this?



When I run the following code, I get the desired result, but isn't there a better way?

NWF$(".customtab input[value='ThreatsTab']").click();

NWF.FormFiller.Functions.ProcessOnChange(NWF$('div [data-controlname="ThreatsLP"] select').first()); NWF$(".customtab input[value='OriginalTab']").click();