I currently have an iFrame which is loaded into SF using syntax similar to below.

<apex:iframe src="SomeURL"

The iFrame contains a self hosted web app which does have some data taken from salesforce. I do have access to some data points for things like the "Contact" [ID,NAME,ETC] etc with in my iFrame.

Is it possible to open a "New Opportunity" for an existing client from within the iFrame?

What are my options for creating a new opportunity by pressing a button in the iFrame. Could it even be to simply open a new window (if possible) using some generic URL plus the company ID field data like the below example for opening a contact.

https://eu9.lightning.force.com/one/one.app#/sObject/<%= company.id %>/view

You can use the apex:canvasApp component to pass a session Id to your hosted website. From there, you can call the REST or SOAP API, direct the user to a Salesforce page, and so on. The specifics will depend on the technology you're using in your canvas app. For more details, read about the Canvas Framework.

  • I don't want to put SF in an iFrame, I have a self made web app which is already embeded in an iFrame already in SF and I to have a button in my iFrame to create a "new opportunity" in SF when you click it. – FMD Mar 15 '18 at 20:44
  • @Fasani Edited to reflect my newer understanding of your question. – sfdcfox Mar 15 '18 at 20:52

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.