You are viewing limited content. For full access, please sign in.

Question

Question

How to add a web access URL in iFrame to a Form?

asked on January 4, 2017 Show version history

I'd like to place an image of a document in a Form so the user can view the document and select options on the Form below.  I'd like to use a document already in the repository.

Both Forms and Web Access are on the same server in the same domain.  Both version 10.

Ideally, the user starts the form with a business process on the target document in the Laserfiche client.

Users will be using a tablet and Laserfiche Mobile to view and fill out the form.

Do I need to use the SDK?  Do I need to buy weblink to make it work?

I've seen a bunch of posts that talk about iFrame and some scripting, does anyone have a solution with some steps i can follow to build it?

0 0

Answer

SELECTED ANSWER
replied on January 5, 2017

Hi Ken

You can use the WebAccess or WebLink URL of the repository document to display it in the iframe, you do not need to use SDK.

You should be using Forms v10.x, the easiest way to display the document is to create the WebAccess/Weblink URL in a Workflow process and pass that URL to a field in your form.

In the Form, create a Custom HTML field and place the following code in the HTML tab to create the iframe. The {dataset/InvFrame} would be replaced by your Variable that holds the URL.

<iframe id="myframe" src="{/dataset/InvFrame}" width="100%" height="600px"></iframe>

The process is the same with WebAccess or WebLink, the challenge being that Forms does not pass the Login Credentials to the iFrame Window, so the first time somebody opens an Form containing an iframe, they may need to login unless the browser remembers the credentials.

Hope this helps you get started

3 0
replied on July 31, 2018

I'm having trouble getting this to work when referencing a token in the URL. If I type in the URL in the html code it works without an issue. I'm on 10.3.1.557. Any thoughts?

When I say it's not working, I mean that I will either end up with a 404 error displayed, or nothing at all in the frame. Ultimately, I'm intending to populate this form with a URL generated from a workflow when a document is scanned in to a certain folder in the repository.

0 0
replied on July 31, 2018

Hi Micheal, does the URL look the same as when you are viewing the document in Weblink or Webaccess? If you copy the URL from the token field that it is stored in and paste it directly in the browser does it work?

Can you provide a sample to review?

0 0
replied on July 31, 2018

yes, the url works perfectly in a web browser, this url is set for autologin and it works. I'm wondering if I need to cause the html component to reload after a change to the token/field.

 

If I replace the token in 
 

<iframe id="myframe" src="{/dataset/URL}" width="100%" height="600px"></iframe>

with the url in the picture, the document loads when I load the page, inline in the form.

 

 

0 0
replied on July 31, 2018

Yes, the custom html window only loads when the form is first opened, so if you are adding the URL to the form after the initial load then the Custom HTML field needs to be triggered again to display the document which has to be done using JS.

 

0 0
replied on July 31, 2018

Thanks, that helps. I think I've got it with this ( which I found at another more recent post you were involved in... thanks!)
 

$(document).ready(function () {
  function loadDoc() {
    var url = $('#q6 input').val()
    var link = "<!-- Invoice Display--><iframe id='myframe' src='" + url + "' width='100%' height='600px'></iframe>";//Create your hyperlink here
    document.getElementById("q4").innerHTML = link; //Insert your hyperlink into my Custom HTML Field (q34 in my case)
  }
  loadDoc();
});

But do you know what the syntax is to reload that html field?

0 0
replied on July 31, 2018

I don't have an example on hand as working through a migration. When I have a chance I'll send you the rest of the code I used. 

I believe it was something like ('#q6 input').trigger.on.change which then called the Custom html routine loadDoc

0 0
replied on July 31, 2018

thanks for your help!

0 0

Replies

replied on January 9, 2017

Thanks Steve.  That was the kick start I needed.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.