0

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:

sdfcIFrameOrigin=https://na6.salesforce.com/_ui/core/email/author/EmailAuthor

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?

Thanks!

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 '17 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 '17 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 '17 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 '17 at 13:20

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.