How long does it take for a UI script change to take effect?

cdgaefke
Kilo Expert

I have a non global UI script that is referenced in a UI Macro by a formatter (maybe it's the other way around) so that I can reference all the routines on my modules without the UI script being global.

 

I'm experiencing very odd timing problems.

 

I'll make a change in my UI script, reload the module, but the changes don't seem to be taking immediate effect.   And I'm not sure exactly how/when to get them to take effect.

 

I typically run with three browsers open:

 

Firefox is my main coding browser.

IE11 is used for my reference, IE, to see something else in SVN while coding in Firefox

Chrome I use for testing functionality

 

Up until now this setup was working fine for me.   I'd make a change in Firefox, save it, reload the module in Chrome and see the changes.

 

Now, however, I'm using the setup above, where a UI script is in a UI Macro that is in a formatter.   And I never know when my code is going to take affect.   I've tried reloading the module, logging out, closing browsers and relogging, pressing Ctrl-F5 to force a refresh, and I'm getting inconsistent results.   Sometimes my code is active, sometimes it isn't.   If I check the code, the changes are there in all the browsers, but it seems as if SVN is using an older version somewhere.   Right now I have a simple alert() in the beginning of my routine, and IE won't show it, but Firefox will.   And my most recent change isn't showing anywhere!

 

Last time this happened I thought I was running into browser compatibility issues, and I went home for the day slightly distressed that I have code that works in one browser and not another.   The next day, without making any changes, it suddenly worked in both browsers!   Now I understand it's the same timing issue I'm seeing now.

 

Any thoughts on this oddness?   It's making coding very difficult, as I never know if I have a typo somewhere or if my code just hasn't taken effect yet.

 

Thanks.

1 ACCEPTED SOLUTION

cdgaefke
Kilo Expert

I ended up opening a ticket on   HI about this.   The devs gave me this code to put in the UI Macro which works beautifully:



<?xml version="1.0" encoding="utf-8" ?>


<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">


          <g2:evaluate var="jvar_stamp">


                  var gr = new GlideRecord('sys_ui_script');


                  gr.orderByDesc('sys_updated_on');


                  gr.query();


                  gr.next();


                  gr.getValue('sys_updated_on');


          </g2:evaluate>


          <g:requires name="YOUR SCRIPT NAME HERE.jsdbx" params="cache=$[jvar_stamp]" />


</j:jelly>


View solution in original post

16 REPLIES 16

This script worked better for me. One question - what do you mean by saying, "g2 is null"?


The end of line 2 xmlns:g2="null"


Here's another good script for multiple files to include:


<g:evaluate var="jvar_ui_script" object="true" >
var gr_ui_script = new GlideRecord('sys_ui_script');
gr_ui_script.addQuery('nameINmyUIScript1,myUIScript2');
gr_ui_script.query();
gr_ui_script;
</g:evaluate>
<j:while test="${jvar_ui_script.next()}">
<g:requires name="$[jvar_ui_script.getValue('name') ].jsdbx" params="cache=$[jvar_ui_script.getValue('sys_updated_on') ]" />
</j:while>

Hi Bell,



I am running on Helsinki and somehow this is not working even after applying this script to handle cache.What could have been the issue?



Warm regards,




MIlap


What script are you using? If you are using the script from Mar 7 above, did you change myUIScript1 and myUIScript2 in 'nameINmyUIScript1,myUIScript2' to the name(s) of your script(s)?