Hi Blake,
I'm hoping someone out there has a better idea but here's one.
Use javascript and hidden fields to bridge the gap.
- Setup hidden fields to hold the data returned from your lookup rule
- Setup your lookup rules
- Setup your custom HTML section and use place holders where the variables would be such as {{variable1}} instead of laserfiche tokens.
- Use CSS to hide the custom div
- Use Javascript to wait a few seconds after the page loads waiting for look-up to complete, take the hidden values populated by the lookup and replace the placeholders in the custom HTML field, display the custom HTML field.
Javascript replace code:
http://stackoverflow.com/questions/5558613/javascript-replace-text-in-the-html-body
Ben used a form of this over here and it lead to a discussion of triggering off a look-up completing:
https://answers.laserfiche.com/questions/68740/Dynamic-Variables-in-Custom-HTML-Field
I was tasked to create something similar. We had to put dynamic values into paragraphs within custom HTML fields. I stored the variables in the fields of a placeholder entry within the repository, served them back in a URL via workflow with values in the URL's query string to populate the hidden fields on the form. Then used javascript to replace the {{placeholders} in the custom HTML with the values of the hidden fields once the document finished loading. When they submit the form, the document is appended to the original placeholder entry so all dynamic information is stored with the entry. Unfortunately when Form s saves the instance to the repository the {{placeholder}} keys show instead of the appropriate values replaced with javascript.
Unfortunately, there doesn't seem to be a unique event to trigger off when a lookup completes. I've tried triggering off the ajax events but was unsuccessful as it appears there's multiple going on to generate the form.
Please post back if you find a better way!