You need to sign in to do that
Don't have an account?
Abhishek Prasad 8
Invoking Javascript ( which is stored in static resource) through a custom button
Hi all,
I have a Java Script (Conga query which runs behind a button). I am asked to create a custom button, which will invoke the javascript (and open a conga template). I have created a custom button on the VF page and put the details over there. However, whenever any change happens in the JS, i need to change the VF as well (not desired). How should i achieve this. This is what i have tried till now:
Custom Settings: putting the JS code in Custome settings, and accessing it in Apex, and subsequently in VF custom button. I cant store the JS code in a custom setting field as my code is more than 255 characters (limitation of custom settings).
Static resource: i read on the net that this could be achieved by: (http://jevonearth.blogspot.ca/2011/08/using-static-resources-with-salesforce.html)
However, REQUIRESCRIPT cant be used for this purpose anymore (summer '16).
How should i proceed?
I have a Java Script (Conga query which runs behind a button). I am asked to create a custom button, which will invoke the javascript (and open a conga template). I have created a custom button on the VF page and put the details over there. However, whenever any change happens in the JS, i need to change the VF as well (not desired). How should i achieve this. This is what i have tried till now:
Custom Settings: putting the JS code in Custome settings, and accessing it in Apex, and subsequently in VF custom button. I cant store the JS code in a custom setting field as my code is more than 255 characters (limitation of custom settings).
Static resource: i read on the net that this could be achieved by: (http://jevonearth.blogspot.ca/2011/08/using-static-resources-with-salesforce.html)
{!REQUIRESCRIPT('/resource/' & LEFT(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(TEXT(NOW()),':',''),'-',''),' ',''),10) & '000/jbUtils')}
However, REQUIRESCRIPT cant be used for this purpose anymore (summer '16).
How should i proceed?
Did you tried the below workarounds
There is a workaround for this. You can access static resource by using a hard-coded URL as follows;
let me know if any luck !
https://success.salesforce.com/ideaView?id=08730000000KRuxAAG
Thanks