Im trying to display RSS feeds (link- http://rss.cnn.com/rss/money_markets.rss) on Home Page. I generated the JavaScript code from http://feed2js.org/index.php?s=build and added the Home Page component by checking "Show HTML' and further added on Home Page layout, but it didnt showed the required RSS feed on Home Page.
Kindly help
[SalesForce] Display RSS Feeds on Salesforce Home Page
Related Solutions
Messy. Real shame that stuff like {!$User.Username}
, {!$UserRole.Name}
doesn't work in the HTML components.
If you have to scrape - try to do it by user id, not by name of the user. I've recently fixed an interesting bug where one trigger didn't work for Hungarian users - trigger was looking for FirstName LastName
and Hungarian locale flips the order like in Asian languages ;)
There's one javascript variable you might reuse without all the hassle of traversing DOM:
var id = UserContext.userId;
console.log(id);
Combine with an array with user Ids and you're getting somewhere. I'd be tempted to explore cookies route too (kind of user preferences) but that means you'd have to assign them somehow in pure JS (cookie served from Visualforce will come from different domain) and you'd need to think how to set cookie if null before relying on its' value so it works ok when new user / new browser is used...
Is AJAX really banned? One query for example to test Group membership (or flag on User), set the cookie and subsequently rely only on the cookie could work and be fairly OK in maintenance.
If you can live with having ugly placeholders in the sidebar use <apex:page rendered="false">
. Put a boolean condition there (if your page has a controller it can be as complex as you need) and on the home page the iframe
will still be displayed, just with blank content.
ALERT UPDATE (Spring'16)
These workarounds were never supported by Salesforce officially. They have worked for many years but now the are no longer possible with the Spring'16 Update. It was announced by Salesforce in 2015 that even the workarounds described in the section below for Winter'16 are shut down with the Spring'16 Release, in February 2016. I verified it on different pods and can confirm it's over. Here are the details:
What is changing?
The Salesforce Technology team is updating code within the standard Messages & Alerts and Custom Links home page components, including JavaScript and custom HTML markup to comply with our evolving security architecture best practices. These changes will enhance the security of your organization.
End of Sidebar workarounds via Messages & Alerts and Custom Links finally in Winter or Spring '16? It's pretty clear and it looks like we have an end-date now.
The new Lightning Experience UI is still evolving. The Lightning Experience UI will probably make a lot of use cases for these workaround obsolete. At this time (2015-10) the new UI is not really feature complete. With the Spring '16 Release it's likely that many features required by typical customers might be there. However in my opinion it won't be possible to migrate all Orgs in 2016-02 on the Lightning Experience UI.
Unfortunately most (or all) of the limitations of the Aloha UI we found reasonable for considering those workarounds are still present.
So the decision to shut down the workarounds at this time can create some extra effort only for an intermediate time until most Orgs can migrate completely to Lightning Experience. It would have been nice, if Salesforce could allow us a little bit more "grace time" for those Orgs, e.g. in form of an critical update or in form of switching that "security improvement" off for one or two releases...
MODIFICATION UPDATE (Winter'16)
Here you can find a way which worked until Spring'16: Requirescript change in Winter '16 release
ORIGINAL POST (Summer'14 to Summer'15 )
At least up to Summer'15 there is a solution without HTML-Areas.
What does NOT work anymore:
New HTML-Areas are useless in Summer'14! Careful with existing HTML-Areas: you save it, you loose it in Summer'14. They get crippled!
It does not work in Winter'16 anymore! It had worked in Summer'14, Winter'15, Spring'15 and Summer'15. For Winter'16 you need this instead and with Spring'16 it looks like an end...
- create a StaticResouce "YourStaticResourceName" upload a JS file containing whatever you need (e.g. jquery) and add a command in the end, like console.log('bingo!');
- go to Setup > Home > Custom Links
- create a new link call it "injection"
- Behaviour = "Execute JavaScript"
- Content Source = "Onclick JavaScript" (don't get irritated, you won't have to click!)
- at the body enter {!REQUIRESCRIPT("/resource/1402932484000/YourStaticResourceName")}
- go to Setup > Home > Home Page Components
- create a new one
- call it "injection-box"
- pick type "Links" (instead of HTML-Area we used before)
- click next
- pick "injection" we created above
- save it
- got to Setup > Home > Home Page Layouts
- add "injection-box" to your layout
- go to anywhere it worked before and check for 'bingo!' in your console. See that 'YourStaticResourceName' is successfully injected to the standard pages :-)
This pattern works in a slightly modified version also for communities: Are sidebar Javascript workarounds also possible for partner portals / communities?
And finally it seems to be even officially supported, look at this: http://help.salesforce.com/HTViewHelpDoc?id=customize_functions_i_z.htm#REQUIRESCRIPT
Here you'll find a knowledge article about what is changing for HTML-Areas and a bit on "why" they do it: https://help.salesforce.com/apex/HTViewSolution?urlname=Home-Page-Components-Changes-Starting-Summer-14&language=en_US
Here you can find and contribute use-cases and possible alternatives for this pattern: Why do we still need to hack the Sidebar? Usecases - Workarounds - Alternatives
Hey guys let's join forces and somehow reach out together to Salesforce and explain to them as a group how important it is to keep the UI open.
Uwe
Best Answer
When copying the JavaScript code over make sure that you paste into the box with the Show HTML checked and leave it checked when you Save. Also make sure not to try and adjust the code (i.e. eliminationg spaces etc). Just paste as is. u will get code for sure i tried now