08-31-2016 7:51 PM
Hi all.
I have created a javascript resource file and am calling it from a script button using a session.utils.include statement.
How do I change the contents of the javascript without needing to recreate the resource file which will create a new GUID? I have tried uploading a new version of the javascript file to the resource but it doesn't recognize that anything has changed.
Thanks in advance,
Cristin
08-31-2016 8:59 PM
Hi Cristin,
The session.utils.include function downloads the script file only once during a session. If you uploaded a new version of the script file, it will be downloaded when you reload the page or close and open the browser tab. The scripting engine ensures that the latest version of the file is always downloaded by using a suffix of the current timestamp to fetch the file. This bypasses caching of files in the browser. Can you reproduce the issue after reloading the page? If this is case, kindly ensure you have the latest version of the client sources.
EDIT: To update an existing resource file, open the resource file in the admin transaction and go to change mode and click on the upload button.
Also, the function has a parameter that can be set to 'always execute' the contents of the file. This can be used in a scenario where the file some code that needs to be executed every time the utils.include function is invoked.
You can find more information in the API documentation using the URL:
http(s)://<hostname>:<port>/sap/bc/personas3/core/resources/doc/PersonasScriptingAPIDoc.html?sap-client=<client>
OR
Scripting API - SAP Imagineering - SCN Wiki
Best regards
Kranthi
SAP Screen Personas Team
08-31-2016 8:59 PM
Hi Cristin,
The session.utils.include function downloads the script file only once during a session. If you uploaded a new version of the script file, it will be downloaded when you reload the page or close and open the browser tab. The scripting engine ensures that the latest version of the file is always downloaded by using a suffix of the current timestamp to fetch the file. This bypasses caching of files in the browser. Can you reproduce the issue after reloading the page? If this is case, kindly ensure you have the latest version of the client sources.
EDIT: To update an existing resource file, open the resource file in the admin transaction and go to change mode and click on the upload button.
Also, the function has a parameter that can be set to 'always execute' the contents of the file. This can be used in a scenario where the file some code that needs to be executed every time the utils.include function is invoked.
You can find more information in the API documentation using the URL:
http(s)://<hostname>:<port>/sap/bc/personas3/core/resources/doc/PersonasScriptingAPIDoc.html?sap-client=<client>
OR
Scripting API - SAP Imagineering - SCN Wiki
Best regards
Kranthi
SAP Screen Personas Team
09-01-2016 4:52 PM
Thank you! I set the "always execute" parameter to true and it is now working.
Cheers,
Cristin