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

Discussion

Discussion

HREF link in Modern Forms

posted on February 2, 2024 Show version history

Trying to get into actually using a modern form instead of a classic design.  What works in classic doesnt seem to work in modern javascript wise so trying to use HTML link.  Looking to simply have a link to a document in Laserfiche by docid.  The docid is a field on the form but cant quite seem to get it.

 

Here is the the href:

<a href="https://servername/laserfiche/Browse.aspx?repo=LF&amp;id=" id="SOWLink" target="_blank"><font size="5">View Contract</font></a>

 

Essentially after the id= I want the value displayed in a field on the the form.  I have tried /dataset or the built in variable but can't get it. 

I can always go back to a classic form to get it to work but would like to try and eventually use a modern one which we have yet to be able to use because of restrictions.

Edit:

 

Going to post here for others as looks like we have something working:

 

window.clickStartTimerButton = function () {
};


var link = LFForm.getFieldValues({fieldId: 27});

LFForm.changeFieldSettings(
    { fieldId: 10 },
    { content: "<a href='"+link+"' target=\"_blank\">Custom Link</a>" }
  );

So Field 10 is simply a blank HTML field on the form.

Field 27 is a field with the full URL of the document in WebAccess populated by the generate search URL activity in workflow.

3 0
replied on February 2, 2024

It looks like the function defined in the first line isn't used, but yes that is exactly what you would do. If that doc id changes on the form from a lookup for example, you can hook into the onFieldChange function to dynamically recreate that html button

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

Sign in to reply to this post.