4

OK so we have a standard page for an custom object. Users would like to have a button or link to another site to obtain information from another web site and application. The problem is that the external application only runs in IE.

What I'd like to do is show the button based on the browser the user is using at the time. Only show the button when they are using IE and hide it when they are using any other browser.

No I can't get the creators of the other site to change so they are browser neutral. They are a MS shop and have created their whole site based on IE specific features.

1

While you can't make a button visible or not on the standard page layout, you could make the button be a Javascript button that checks the user's browser and then either redirects them or displays an alert message that they must use IE.

| improve this answer | |
  • That may work. I'll run that option by the users when this one comes up for work. – Robert Harper Oct 28 '13 at 16:28
  • That worked just fine and will probably be the solution. For others, in your javascript, do if( navigator.userAgent.indexOf( "MSIE" ) > -1 ) to check for IE then do normal javascript to either use window.alert() to pop up a message or window.open( url, title, options ) to go to the assigned link. – Robert Harper Oct 29 '13 at 13:45
1

This seems more a css issue. Give the button a class named btn_special_class Set in the header:

<style>
.btn_special_class {display:none;}
</style>

And then make it visible for ie

<!--[if IE]>
<style>
    .btn_special_class {display:inline;}
</style>
<![endif]-->
| improve this answer | |
  • I beleiev he's asking about a standard page, not a VF page – Chris Duncombe Oct 28 '13 at 14:18
  • SF_Ninja, you are correct. I wasn't sure what to tag it with. Since you can have a button point to a VF page, I used the VF tag. I don't want to have to transition to multiple pages but at the same time, I don't want the button to be visible when the browser isn't IE. If it were a VF page, I'd be able to add the javascript but alas, such is not the case. – Robert Harper Oct 28 '13 at 14:37
1

You will likely need to use a homepage component to inject some Javascript into the standard page.

Setup -> Customize -> Home -> Home Page Components

Create a New Custom Component with the type as an HTML area. Use the show HTMl checkbox and now you can have any html/javascript to traverse the DOM of the page

Since you seem to only want it on this one particular page, you would maje it a wide component. If you wanted it to run on every page, you would make it a narrow component and change the UI settings to show the Sidebar on all pages.

This is my Safe Harbor Statement to using this method. This method works, but should be used at your own risk. You are in essence, injecting code into the standard SF page, so any changes to the SF standard pages, could effect or break your code. Just a forewarning. This method definitely works, but it is somewhat 'Hackish'

EDIT

Actually looks like @RajatPaharia and @MetaDaddy did a pretty good explanation of this for another question. Take a look

How can I execute JavaScript on a SFDC Standard Detail Page?

| improve this answer | |
  • That isn't quite what I want to do. I can't guarantee that the user is showing the side bar and they want a button right on the page. I might have to just make it a training issue that they have to use IE but since most of the sales people use the Apple products, this might end up being something of a non issue. – Robert Harper Oct 28 '13 at 14:45
  • If you can't control some of these outside variables, then yes, it does seem like more of a training issue for the end users. If they are mostly using macs, bonus for you as you only have to worry about the limited number of PC folks. Good luck – Chris Duncombe Oct 28 '13 at 14:53
  • The hard part is that most of the powers that be don't take, "It doesn't work that way." for an answer. I find this odd with IT managers that should know the difference between the way a web browser works as apposed to a desktop application that is hard wired to the OS and it's technology. – Robert Harper Oct 28 '13 at 15:47
  • I feel your pain. Been there as well. Very frustrating. – Chris Duncombe Oct 28 '13 at 15:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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