Question
Accenture
IN
Last activity: 12 Jan 2016 1:00 EST
Best place to include javascript function?
If I want my javascript function available through out the application.
What would be the best place where I can include my js file?
Which I will be able to call directly from a html rule, or through run script.
P.S
I am using Pega 7.1.7, IE 11 browser
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Accenture
IN
How about including the bundle desktopwrapper • script ?
After which the function is available throught the application.
Is this way ok? or including it in the harness should be the standard way?
Both the method seems working. Is the first method , i.e the Bundle way seems ok?
Pegasystems Inc.
IN
Portal harness. Refer JS rule in 'Scripts and Styles' tab.
Accenture
IN
Then I need to put that in all the portal harness.
So if someone creates a new portal harness and forgot to use that then the script wont work.
It will be a additional thing that has to be kept under observation.
Is there any other place where if we include, then we need not any where in the system ?
Pegasystems Inc.
IN
so we're attempting to apply this js by default? if that's the case - would customizing HTML fragment 'UserWorkForm' helps? Please share your thoughts/comments, Thank you!
Accenture
IN
Will try and share the result, Is there any other way. I thought there might be some bundle where I need to add my js
Pegasystems Inc.
US
If you truly need it on every screen without fail, then UserWorkForm is the place to add it. Keep in mind this will impact every portal - including Designer Studio.
I don't think that adding it to individual portal harnesses is too much of an ask, and is in my opinion the safer location. I have never seen an application with more than 3-4 individual portals, and you typically don't want developers creating them on a regular basis in your application. Any new portal should be thoroughly vetted to ensure it's necessary and planned out before build.
Accenture
IN
I wanted to make this js available through out the application, so that I can call the script in them from anywhere in the application. From a button click using runscript, from a custom html rule and so on..
Accepted Solution
Accenture
IN
How about including the bundle desktopwrapper • script ?
After which the function is available throught the application.
Is this way ok? or including it in the harness should be the standard way?
Both the method seems working. Is the first method , i.e the Bundle way seems ok?
Pegasystems Inc.
IN
the Bundle way seems ok?
- Yes I think.
Accenture
IN
Thanks for the Confirmation âº
Accenture
IN
this rule should be kept under observation while upgrade, right?
As the bundle rule may be upgraded in prpc upgrade, and we need to make sure to include our rule in the latest bundle.
Pegasystems Inc.
IN
>>> this rule should be kept under observation while upgrade, right?
yes
Accenture
IN
Thanks for the confirmation âºâº