28

As per release winter 16 release notes: http://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/salesforce_release_notes.htm

In summer 15 release salesforce disabled JavaScript hacks through sidebar, am I confusing myself about this note in Winter 16 or is this the final nail in the coffin for preventing UI alterations through javascript using buttons and links?

REQUIRESCRIPT No Longer Executes JavaScript On Page Load

We’ve changed the way custom JavaScript buttons and links work when they use REQUIRESCRIPT. The REQUIRESCRIPT resources aren’t included in the page until the user clicks the custom JavaScript button or link.

  • 2
    That's definitely my take on this change. – Force2b_Mike Sep 18 '15 at 23:45
  • I've made extensive use of this feature and it is going to hurt now that it is gone. Another door slammed in our face. – user24834 Sep 21 '15 at 1:49
  • there's still a way. let me just document my finding.... – pnoytechie Sep 23 '15 at 12:30
  • Please let me know if you have any alternatives for Requirescript. We use this function on page load. Much appreciated. Thanks Sivarajan – sivarajan Dhandapani Sep 24 '15 at 0:58
  • @pnoytechie do you mind sharing your workaround? Or did Salesforce nab you before you could spill the beans? – JCD Oct 1 '15 at 18:30
7

We shouldn't have been doing those things in the first place.

I would assume that by implementing these hacks, we've moved on thin ice and built features that could not be regression tested by salesforce and thus get broken by salesforce. This would not just reflect poorly on those who've created additional functionality, but on salesforce as a whole.

My guess is that salesforce is indeed closing the loopholes they should have closed a long time ago.

  • 1
    +1. If Salesforce tell you something is unsupported and you shouldn't use it, then guess what? You shouldn't use it. – Matt Lacey Sep 24 '15 at 4:10
7

At this point I guess the only 2 ways remaining open for a short time are Messages & Alerts and Custom Links, where you still can inject JS into standard Aloha Salesforce pages. Alternatively you could try to use a community, where you can inject JS via Header and Footer.

But even these will be shutdown with Spring'16 as announced by Salesforce via Email and Knowledgebase Articles as I've described here: End of Sidebar workarounds via Messages & Alerts and Custom Links finally in Winter or Spring '16?

Moving the JS injection to Messages & Alerts is pretty easy. You can do this in less than 5 minutes. It will buy you 3 additional months of Aloha-workarounds. Just put Messages & Alerts on the Home-Page-Layout, go to Home-Page-Components, open Messages & Alerts there and add something like this in the text-box:

<script src="/resource/1402932484000/YourResourceName">

/1402932484000 is a timestamp, which can also be omitted or any other number can be used. YourResourceName is a JavaScript static resource. If you want to include stuff from managed packages you need to prefix it like:

<script src="/resource/1402932484000/Prefix__YourResourceName">

Also I wouldn't blame just us on this. For us, who used this, we did this with tears in our eyes - not with fun. The Aloha-UI is just sooo low-fi that it simply isn't enough for some state-of-the-art solutions. Visualforce-overrides or entire custom UIs come also with massive trade-offs. The workarounds were last, desperate measures where we simply could not deliver hi-fi UIs based on Aloha. Now the Lightning Experience UI should make most of the use-cases obsolete. Unfortunately we can't use LE immediately in all Orgs where necessary and even Spring'16 is too soon to let us switch all those Orgs to LE smoothly and without disruptions.

So I have no problems with the fact of the shutdown of Aloha-UI workarounds at all, but I would have been very happy if Salesforce had adjusted the shutdown-speed to the time they need to deliver a fully featured Lightning-Experience UI. We, also, need some time and without LE the was no smart way to deliver.

Anyway, if anyone at Salesforce is reading this: a little bit more time would be cool and I'm sure we all will happily throw these hacks in the trash where they belong.

Community Alternative

You could also try to setup a community for some of your use cases. Injection of JS there is very simple via Footer or Header HTML when you customize the community UI. Even if you go with standard salesforce licenses and features, you could redirect some processes to a community UI where I could not find strong restrictions.

protected by Community Sep 24 '15 at 4:10

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).

Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged or ask your own question.