I have a Form Prefill service that is using the Fluent Form Prefill Template. This gives me access to the Form object
(Document invoke(SvcDef svcDef, Form form, Document formXml,Txntxn, HttpServletRequest request, User user) throws RedirectException )
that I can query for information; however, the
returns "The current form version id (PK)" which returns a long ID (i.e. 2239)
1, I am not clear on what is meant by PK
2. Is there any way to use that value to find the version (i.e. 1 or 2) of the form that was opened?
– Thank you for the suggestions and information. I thought PK stood for Primary Key but wasn't positive. I don't think the two suggestions will help (the form object in the Prefill Service Template does not have a getCurrentVersion() function and the txn object is null – txn.formVersionNumber – so that won't work.
I was hoping to use one of the parameters passed into the Prefill Service to do some further querying; however, I think I am at a dead end on that route so I will try another direction unless someone else has an idea.
Looks like the current APIs won't allow you to get the version of the form being prefilled.
Set<String> form.versions will give you all possible versions, but no indicator of which one is being prefilled.
Additionally, the formXml document has not been populated with TemplateVersionNumber at the point the script runs, so you can't get it from there.
You might need to create a TPD to make version information available if you need it.
You could look at tmFormVersion request parameter on the HttpServletRequest object, but that might not always be present.
Thanks for all the suggestions. I will close this off and see if I can get that feature added in future releases of the API
That field should point to the form version number for the current transaction:
PK stands for Primary Key... the database primary key column.
Can you call getCurrentVersion() on the Form object?