Application Development Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 

Personas 3.0 - Update javascript resource file

cristin_charbonneau
Participant
0 Kudos

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

1 ACCEPTED SOLUTION

0 Kudos

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

2 REPLIES 2

0 Kudos

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

0 Kudos

Thank you!  I set the "always execute" parameter to true and it is now working.

Cheers,

Cristin