Help me open an URL in POP - UP , the URL is stored in a Salesforce Custom Field.

  • 1
  • Question
  • Updated 6 months ago
  • Answered
I have been trying to open a Third Party link in a Pop-Up using iFrame.

The Link gets open in the Pop- Up when we hardcode the link, but when we try to access the link dynamically from a model.  The POP - UP Turns blank.
Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
  • frustrated

Posted 7 months ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Nikita,

Would you share XML for the iFrame and confirm what type of field you are storing the URL in.  Is it also a URL field type or a Text field?

Thanks,

Bill
Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
Hi Bill,

Thanks for responding. Just to answer your question The field type is URL in salesforce where we are storing the link.

Thanks
(Edited)
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Nikita,

I think it may be one of two things:  you will need to use the 'triple mustache' to have the URL render as the raw text instead of as a 'link' (which will include the HTML for the anchor tag (i.e. '<a href="...').  The other thing I would check is the context of your Template component.  Make sure you set the Model property to the model that has your URL field.

Here is a screenshot of the template component with the iframe.



Thanks,

Bill
Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
Hi Bill,

I have used the 'triple mustache' while trying to access it in iFrame. Also, I have attached the Screenshot of the same here with.



Also, just to re-iterate the template component is in a POP-UP Action when we click on a Button.



Thanks

Nikita
Photo of Bill McCullough

Bill McCullough, Champion

  • 12,436 Points 10k badge 2x thumb
Nikita,

The HTML in your template looks good.  I would check 3 other things.  First, check the Field security settings, make sure that you have Read access to the field.  Second, put the field on your page somewhere to make sure that you have a URL in the field.  Use a Template 'field' and drop the field using the triple mustache.  Lastly, copy the field value from your page and try opening the URL in another tab/window.

Thanks,

Bill
Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
Bill,

Thanks for your suggestions - 

1. Field - Level Security has Read Access to the field.
2. Field on the page -
    
    I have tried to achieve it in two ways - 
  •     Using the field directly in FieldEditor in the base page- Where we can see the URL in the field. But is not visible in Pop-Up.


  • Using the template - {{{Field Name}}} - The URL is only visible on the base page. I cannot see the URL in the Pop-Up.


The Template field also contains the same field and on this page, we can see the URL clearly.



But in the Pop-Up where we have set-up the iFrame, the URL is not getting displayed.



3. Opening the URL in a new Tab - It works fine.

Thanks

Nikita
(Edited)
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,040 Points 10k badge 2x thumb
Hi NIkita,

Bill's got great suggestions here. I also wanted to add a possibility that I ran into recently. Depending on 1) your org's security settings and 2) what you're trying to load in an iframe, the attempt to show this in an iframe may be getting blocked by Salesforce.  Are you seeing any errors in your browser console when the iframe fails to load? If so, what are they?

Best,
Mark
Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
Hi Mark,

All possible suggestions are welcomed.

1. What exactly do I need to take care in terms of my Org's Security Settings?
2.  Yes, I just saw the console - we are getting a URL blocked error.


Thanks

Nikita
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
Hmmmm ... have you tried using the following global merge functions? You can this in Skuid Help here. Seems to me that this is the issue.

Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
Hi,

I just tried to work with the suggestion you provided -

Following is the iFrame -



and the follows the output -



Please suggest.
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
View the source of the page to see what the iframe element looks like.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,040 Points 10k badge 2x thumb
Hi Nikita,

We'll need to see what the URL is to understand why it's not working. I'll highlight the suggestions that have already been made to look for the iframe's URL in your page's source, and also to try the iframe's URL in another browser tab to see if the link works outside of an iframe. Finally, you should be able to open the network tab in the browser developer tools, then reload the page & iframe. In there, you should see a request listed for the iframe's URL, as well as the results of the request. 
Photo of Nikita Ladia

Nikita Ladia

  • 214 Points 100 badge 2x thumb
Hi Mark,

I was explaining it to Bill that the URL works fine in a new tab.

But the problem I am having is to open the URL in the iFrame.

Also, I would like to mention I tried to load the iFrame, but could not find any records in Network Tab.

Thanks and Regards

Nikita
Photo of mB Pat Vachon

mB Pat Vachon, Champion

  • 42,704 Points 20k badge 2x thumb
In your first post you said you were able to  hard code the URL successfully. This essentially means that something is awry with the URL. We need to see the URL as produced by the Skuid page.
Photo of Mark DeSimone

Mark DeSimone, Official Rep

  • 11,040 Points 10k badge 2x thumb
Hi Nikita,

Were you ever able view the page's source code and grab the iframe's markup?