I'm trying to embed a standard salesforce records page and one of the criteria for the webapp that I'm using to do that is that the iframe url be terminated with a filetype extension.

Looking at the home page I can see that it uses .jsp but all other pages (solutions, chatter, etc) give a 404 when I try attaching that extension.

Note: I'm not the salesforce dev, he's basically unreachable so I figured I'd try my luck here.

A little more info: I'm trying to embed a solution detail, from a standard salesforce records page into an overlay that will show up in other parts of salesforce. The overlay is a chrome extension that everyone has installed called WalkMe, they have a kinda draconian regex for their text formatting that is very broken and I'm trying to avoid using it, instead I'd like to use an iframe to embed the info using salesforce's solutions (or possible knowledgebase) pages. Optimally I'd only grab the solution detail and nothing else, but I don't know if it's possible to do that without hassling the overworked salesforce dev.

EDIT: I've added a few edits to the page and noted them in italics.



Visualforce pages don't have an "extension" in the traditional sense. They're simply referenced as /apex/PageName. If you want to embed the page, the platform you're using has to accept the fact that there is no extension. The ".page" and ".vfp" extensions you see from time to time are merely metadata conventions, and do not reflect how the page is actually invoked. This is true for most pages in salesforce, except for Classic Home, Classic Setup menus, and Lightning.

| improve this answer | |
  • Just to clarify, you're calling it visualforce but in the other answer I was called out for using that term to refer to a standard salesforce record page. Is there a difference, if so could you point me to a doc that outlines it? Other than that, you're saying that salesforce doesn't use file extensions for most record pages? – Yiz Borol Dec 20 '16 at 18:25
  • @YizBorol Salesforce simply has an aversion to using extensions for pretty much anything. Static resources? No extension. Records? No extension. Reports and dashboards? No extension. There's a few exceptions to the rule, such as .servlet, .Integration, and .jsp, but those are rare. – sfdcfox Dec 20 '16 at 18:29

From another, similar question:

  • For Apex classes, the extension is .cls,
  • For Apex trigger, the extension is .tgr,
  • For visualforce page, the extension is .page.

When I download metadata however, it gets returned as .trigger so I'm not sure about the .tgr.

As you've mentioned embedding a Standard Page into a Web App, my advice would be not to go down the iFrame route especially if the Web App is public facing.

Assuming your Web App has a registration and login facility, you'd also need them to be logged into Salesforce as well as the Web App. You'd also be exposing your Org as if you try to iFrame in a standard record page, you'd bring along the header, sidebar and everything in it which is dangerous. Even if the Web App isn't public facing, it's still pretty inconvenient having to log in twice.

I'd recommend using either a SOAP or REST API to get the information you want. You can (albeit with the help from your Salesforce Developer) make a REST or SOAP class to make requests to and get either a JSON or XML response respectively, or you could use some other "ready made things". I'm familiar with PHP so am biased towards that, but you could create vanilla REST client or use SOAP Toolit. If you're using a Framework, things exist like Forrest to make your life easier. None require Apex.

The only thing you'd need to decide on is your flow:

  • UserPassword: - Requires the User to log in using their Salesforce credentials, to access Salesforce
  • WebServer: - Automatically logs the User in to Salesforce using "hard coded" credentials to a User that has limited access to the org (i.e. only can access what they need).

I hope this isn't too presumptive, but I really would avoid using an iFrame. The main point is that if this is your aim is just to show data in Salesforce, there's better ways to do it.

| improve this answer | |
  • Thanks, I found that actually but none of those worked, it could be I'm going about this incorrectly. I'm just taking the url (say my.salesforce.com/50131000000r45x) and appending .page or or cls to it and seeing if that loads. Unfortunately all those extensions give a 404 – Yiz Borol Dec 20 '16 at 17:08
  • That's not how you open a file...you need an IDE. – Adrian Larson Dec 20 '16 at 17:09
  • 1
    @YizBorol If you're attempting to access my.salesforce.com/50131000000r45x, you'd be trying to open a standard record page, not a Visualforce page. Visualforce pages are accessed via my.salesforce.com/apex/MyCoolApplication – Dan Jones Dec 20 '16 at 17:13
  • @AdrianLarson I'm no trying to open the file, I'm trying to embed it... The file isn't downloaded to my computer it's on the salesforce server. Danjones: So in that case I guess I'm trying to access a standard salesforce record page. I didn't really realize there was a difference, I've edited my Q to remove the visualforce tag (I'm not really sure how it got there in the first place, I think I was trying to add a page tag, and it somehow converted to visualforce when the question was published). Sorry for the confusion. – Yiz Borol Dec 20 '16 at 17:26
  • @YizBorol Where are you trying to embed the page? Is it on Salesforce or on the Web App? – Dan Jones Dec 20 '16 at 17:28

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.