[SalesForce] Using static resources in OnClick Javascript buttons after “Serve Static Resources from force.com domain” critical update

We're using list view and details OnClick Javascript buttons which reference custom js ans css files stored in static resources and containing some shared logic/styles. The sample code below demonstrates how they are referenced.

{!REQUIRESCRIPT('/resource/CustomJQuery/js/jquery-1.10.2.js')}

{!REQUIRESCRIPT('/resource/CustomLib')}

$("head").append($("<link rel='stylesheet' href='/resource/CustomJQuery/css/smoothness/jquery-ui-1.10.4.custom.css' type='text/css' media='screen' />"));

These files are also referenced in Visualforce pages.

Introduction of "Serve Static Resources from force.com domain" critical update breaking this way of using static resources in OnClick Javascript buttons – there is also Known Issue created for this https://success.salesforce.com/issues_view?id=a1p300000008XRLAA2.

So, my questions are:

1) Are there any ways to make it work with "Serve Static Resources from force.com domain" critical update activated. My assumptions for now are below, but they seem to be risky and may require significant changes:

  • hosting these js and css files on own server and referencing them in OnClick Javascript buttons and all other places;

  • move to custom visualforce pages;

2) Does anyone know what's going on with "Serve Static Resources from force.com domain" critical update right now? It was scheduled in Winter 15 first, then it was postponed to Summer 15. Now it can't be found in any org in list of all critical updates at all. It has even disappeared from the list in orgs where it used to be 1-2 weeks ago.

3) How long Known Issue can be "In review" status, since related one has this status for more than 2 months?

Thank you

Best Answer

I've raised a similar questions some time ago when I first saw that critical update:

Critical Update "Serve Static Resources from the Visualforce Domain" still serves resources via Salesforce Domain

What I got there was, that the critical update has had no impact since SF was doing a 302 redirect. In other words: turning it ON or OFF made absolutely no difference for me. The resources has been served and loaded without error.

Still I'm using Resources at several places this way and I can only confirm they are working today.

enter image description here

Also I can confirm that the Critical Update is no longer visible.

Why can't I see this Critical Update?

The Updates are only visible in a specific timeframe in which you can turn them on and off. This is very selective only to Orgs to which these updates apply and only if Salesforce decides to show them. Usually once enabled stuff from the past will disappear after that timeframe and can't be manipulated anymore.

Related Topic