Visualforce page html question?

  • 1
  • Question
  • Updated 5 years ago
  • Answered
Archived and Closed

This conversation is no longer open for comments or replies and is no longer visible to community members. The community moderator provided the following reason for archiving: Answered with other post.

Trying to load the visualforce page as an html iframe but can't seem to get it to work.

Here's the visualforce page:

<apex:page standardController="Listing_Mgmt__c"> 
 <apex:stylesheet value="{!$Resource.box__BoxFilesCSS}" /> 
 <apex:iframe src="https://www.box.com/widget_sso/salesforce?token=%7B%22server_url%22%3A%22{!URLENCODE($Api.Partner_Server_URL_120)}%22%2C%22session_id%22%3A%22{!URLENCODE($Api.Session_ID)}%22%7D&salesforce_object_typed_id={!$CurrentPage.parameters.Id}&partner_object_type=Listing_Mgmt__c&partner_object_name={!Listing_Mgmt__c.name}&partner_object_email=&partner_object_id={!$CurrentPage.parameters.Id}&open_new_window=1&partner_user_id={!URLENCODE($User.Id)}&partner_user_name={!URLENCODE($User.FirstName)}%20{!URLENCODE($User.LastName)}&partner_user_email={!URLENCODE($User.Email)}&email_recipients=&debug=0" width="100%" height="100%" scrolling="true" id="theIframe"/> 
</apex:page>

This is the skuid html code:
<iframe src="https://www.box.com/widget_sso/salesforce?token=%7B%22server_url%22%3A%22{!URLENCODE($Api.Partner_Server_URL_120)}%22%2C%22session_id%22%3A%22{!URLENCODE($Api.Session_ID)}%22%7D&salesforce_object_typed_id={!$CurrentPage.parameters.Id}&partner_object_type=Listing_Mgmt__c&partner_object_name={!Listing_Mgmt__c.name}&partner_object_email=&partner_object_id={!$CurrentPage.parameters.Id}&open_new_window=1&partner_user_id={!URLENCODE($User.Id)}&partner_user_name={!URLENCODE($User.FirstName)}%20{!URLENCODE($User.LastName)}&partner_user_email={!URLENCODE($User.Email)}&email_recipients=&debug=0" width="100%" height="100%" scrolling="true" id="theIframe"/> 

.....
The error I'm getting is that box.com can't verify the single sign on  any thoughts?








Photo of Dave Zadareky

Dave Zadareky

  • 272 Points 250 badge 2x thumb

Posted 5 years ago

  • 1
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,848 Points 20k badge 2x thumb
Take a look at the conversation that happend last week about exactly this topic:   https://community.skuidify.com/skuid/topics/adding_a_box_custom_component_or_template_to_my_page


Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
https://community.skuidify.com/skuid/topics/adding_a_box_custom_component_or_template_to_my_page
Check out this thread. One of the things with skuid is that it doesn't work the same way as classic visualforce. For example
"{!URLENCODE($Api.Partner_Server_URL_120)}"
becomes "{{{$Api.Partner_Server_Url}}}". 
You can't use the same exact syntax as before. You have to create a model on your "Listing_Mgmt__c" object and grab fields from there. As well as a RunningUser model. I can post an example of something I've done with a custom object if you would like.

Photo of Dave Zadareky

Dave Zadareky

  • 272 Points 250 badge 2x thumb
Yes please!  Thanks.  This will solve a big problem for me.
Photo of Moshe Karmel

Moshe Karmel, Champion

  • 8,686 Points 5k badge 2x thumb
<iframe src="https://www.box.com/widget_sso/salesforce?token=%7B%22server_url%22%3A%22{{{$Api.Partner_Server_Url}}}%22%2C%22session_id%22%3A%22{{$Api.Session_Id}}%22%7D&salesforce_object_typed_id={{{$Model.SalesInvoices.data.0.Id}}}&partner_object_type=c2g__codaInvoice__c&partner_object_name={{{$Model.SalesInvoices.data.0.Name}}}&partner_object_email=&partner_object_id={{{$Model.SalesInvoices.data.0.Id}}}&open_new_window=1&partner_user_id={{{$Model.RunningUser.data.0.Id}}}&partner_user_name={{$Model.RunningUser.data.0.FirstName}}%20{{$Model.RunningUser.data.0.LastName}}&partner_user_email={{$Model.RunningUser.data.0.Email}}&email_recipients=&debug=1" width="100%" height="550px" frameborder="false" scrolling="false"></iframe>
In my case I have a custom Sales Invoice object, and a model called "SalesInvoices" on that object as well as a model on the User object called "RunningUser" with a condition that the Id = UserId of the current User. You have to create a model on your custom object and replace every instance of "SalesInvoices" with the name of your model. You also have to create the RunningUser model the way Rob described in the other post.
Photo of Dave Zadareky

Dave Zadareky

  • 272 Points 250 badge 2x thumb
Wahooooooo!!! That's fantastic. Works perfectly.
Photo of Rob Hatch

Rob Hatch, Official Rep

  • 44,848 Points 20k badge 2x thumb
Thanks for your help here Moshe.. 

This conversation is no longer open for comments or replies.