1
0
-1

Hello


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

form.formVersionId 

returns "The current form version id (PK)" which returns a long ID (i.e. 2239)

Two questions:

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?


Thanks


    CommentAdd your comment...

    3 answers

    1.  
      1
      0
      -1

       – 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.

      1. Bill Frost

        Hi Gary,

        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.


      2. Gary Thain

        Hi Bill,


        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 

      CommentAdd your comment...
    2.  
      2
      1
      0

      Hi Gary

      That field should point to the form version number for the current transaction:

      txn.formVersionNumber


      Cheers
      Rado

        CommentAdd your comment...
      1.  
        1
        0
        -1

        Hi Gary,

        PK stands for Primary Key... the database primary key column.

        Can you call getCurrentVersion() on the Form object?

        Bill

          CommentAdd your comment...