I have a custom sidebar component that needs to get record context in Salesforce. I was doing this using the sdfcIFrameOrigin value from the page parameters. This works when viewing the record itself, but when on ancillary pages like the New Comment or Send an Email page, I am no longer getting query string parameters in the page parameters.

I used to get this from the sdfcIFrameOrigin field, but now this removes all of the page parameters.

For example, if I access the emailAuthor page, I will get:


instead of:

sdfcIFrameOrigin=https://na6.salesforce.com/_ui/core/email/author/EmailAuthor?p3_lkid={RECORD ID}

I believe this changed in either the Spring or Summer 17 releases. I cannot use Javascript to get the parent window location because the Visualforce component is in an Iframe served from a different domain than the parent frame so it will cause cross domain errors.

Does anyone have any ideas how I can get record context from my sidebar component in my example of the EmailAuthor page?


1 Answer 1


Realistically, you won't be able to get the location because of security restrictions, so if Salesforce doesn't give you the data, either, then you're not going to be able to do anything about it. You could probably get away with using a custom link to your page, which will probably be able to access the "Referer" header (no, that's not a typo) to read the URL and get the ID you're looking for.

  • That is the unfortunate thing. I'm using a Visualforce page that is set up as a a narrow sidebar component. This was working within the last few releases and Salesforce changed something. I can't find it documented anywhere so I am wondering if it is an unintentional change. They clearly intend to give us some context data for the parent frame (and we get it in the uri parameter when running as a console component), but they are cutting off the query parameters in the standard UI. I'm going to open a case with them, but they are probably not going to be helpful.
    – Chris F
    Oct 15, 2017 at 22:46
  • @ChrisF Yeah, hopefully you have premier support, at least you'd get a chance. I'll also check some side channels about this.
    – sfdcfox
    Oct 15, 2017 at 22:54
  • I know... I'll probably create the case, it will get closed and I'll have to pursue it in the partner community. Unfortunately, this is a problem that I inherited and it should have been pursued with support when it first started happening because it would have been a lot easier to track down and get a resolution.
    – Chris F
    Oct 16, 2017 at 0:52
  • I found this documentation help.salesforce.com/… and was hopeful that it would work, but the suggestion get the query parameters individually from $CurrentPage.parameters does not actually work.
    – Chris F
    Oct 17, 2017 at 13:20

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .