Subscribe to my full feed.

This is Part 5 of 5 in my series on converting 15-character Salesforce IDs seen in the Salesforce UI into the 18-character IDs seen in results from the Data Loader and API calls. You can start at Part 1 here.

Wrapping this up - we have the problem, the solution, the solution code, and the visualforce. Let's display it on the homepage.

You have two options:

Option 1: Put in on the main section of the home page.
Pros: Can HIDE the "Developer mode" section that gets in the way
Cons: Have to go to the home tab to use the widget.

Option 2: Put it in the Sidebar
Pros: It's there for you throughout the application (if your sidebar settings allow)
Cons: have Developer mode turned on? Then this won't work.


Either way, here's the process:
1. Create a custom home page component. (Setup->Customize->Home->Home Page Components->New->HTML Area)

2. Select which part of the page you'd like it on - Wide (main), or Narrow (sidebar).

3. Click "Show HTML", and enter the code below:

<iframe src="/apex/IDconverter" height="150" width="100%"></iframe>

Note that you should replace the src="" with whatever the address for your Visualforce page is.

Scott Hemmeter from ArrowPointe shared a great trick on his blog to disable developer mode on this page so your homepage component displays correctly. As he mentions, this is "unofficial" functionality, so could stop working at any time.

It's simple - just add "?core.apexpages.devmode.url=1" to the address above, resulting in "/apex/IDconverter?core.apexpages.devmode.url=1".

As I mention in the pros/cons above, this worked for me on my main homepage - but NOT in my sidebar (although others have had better luck). Best of luck to you!

And that's that. Now, my admins have a little widget to let them quickly answer the dreaded "What's the 18-char ID of the record" question we get when working with IT. Here it is:



And that's the end of that - hope you found it helpful - we'll have to do this again some time.


0 comments:

Post a Comment