function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Gab SilvermotionGab Silvermotion 

Load html code or iFrame using buttons & onclick javascript?

Hello! We started using a booking solution and they have a bunch of way we can add this to our website and marketing emails and we did. I'd love to place that widget on my opportunity layout. is there a way to do this?

This is what the code looks like.: 
Website (HTML)
<img id="scheduling-12773625" src="https://www.agendize.com/web//img/scheduling_en.gif" onclick="openScheduling(12773625)" style="cursor : pointer; border: 0"/> <script type="text/javascript">var scheduling = {server: 'www.agendize.com', button: '16065759', lang: 'en'};</script> <script type="text/javascript" src="https://www.agendize.com/web/scheduling.js"></script>


iFrame
<iframe src="https://www.agendize.com/book/iframe/12773625?lang=en" frameborder="0" style="width: 750px; height: 510px; border: 0" marginwidth="0" scrolling="auto"></iframe>


 
bob_buzzardbob_buzzard
The best practice way to include an external web site into Salesforce is via a canvas application, but if you don't own agendize you won't be able to make the required changes on their end.

What you can do is embed a Visualforce page in your opportunity layout that embeds the iframe the page itself can then use the apex:iframe tag. A very simple example of this is:
 
<apex:page standardcontroller="Opportunity">
  <apex:iframe src="https://www.agendize.com/book/iframe/12773625?lang=en" frameborder="0" width="750" height="510"/>
</apex:page>

As this page uses the opportunity standard controller, you can add it to the page layout.