Linking to a previous form in a Form Library - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Linking to a previous form in a Form Library

Last post 08-14-2018 07:31 AM by darrenfloyd666. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 08-07-2018 06:14 AM

    Linking to a previous form in a Form Library

     Allo!

     I have a requirement to link to a previous form in a form library so a user can go back and edit it. I'm using a data connection to receive data from the library in question. It's giving me a list of the forms but not the ability to link and open.

     What's the best way of achieving this? Any advice gratefully received! 

  • 08-07-2018 11:37 AM In reply to

    Re: Linking to a previous form in a Form Library

    I do have this scenario for a browser enabled form.

    I added two additional fields to my form, one to hold a the current formname (file name as appears on SharePoint)  and one to hold a hyperlink to the form. I also added a button with a rule. 

    Field 1: "oldform_name"  is a empty text field to hold what will become the previous form  My rule on my button will set this field.

    Field 2: is a 'hyperlink' that contains the URL to the current file that is open. I don't set this by any rule, this is the default value of the field.
       Formula:   concat(SharePointSiteUrl(), "CM/", txt_oldFormName, ".xml?OpenIn=Browser") 

    Button:  

       Rule1:  Condition "none"
         Action 1:Sets Field 1 value "oldform_name" = formname. <set oldform_name to the current open forms formname>
         Action 2: Set (create) a new formname
         Action 3: Submit to SharePoint
         Action 4: Close this form: No Prompt.

    It may look a little counter intuitive - what this does is saves the current forms URL and Formname into two fields. Submits that form to SharePoint with a new formname (file name) and then closes it. 

     ----------------------------------- see visual below ---------------------------------

     


    I cannot upload my actual form as it is 'very huge and complex' but if you need a simple demo form let me know.

     


    Laurie Wheeler
  • 08-08-2018 03:22 AM In reply to

    Re: Linking to a previous form in a Form Library

     Thanks Laurie. I'll give that a go.

  • 08-13-2018 06:37 AM In reply to

    Re: Linking to a previous form in a Form Library

    Hi Laurie

     

    A few questions.

     

    So pop the formula: concat(SharePointSiteUrl(), "CM/", txt_oldFormName, ".xml?OpenIn=Browser")   into the  Hyperlink control properties? I've attached what I get an I can't see where to put the formula?

     Also on Action 2 on the button: Set (create) a new formname what do I set the Field and the Value fields to?


  • 08-13-2018 07:51 AM In reply to

    Re: Linking to a previous form in a Form Library

    Darren, Working example is often worth lots. So, I created and attached to this posting a working copy. This is a client application form. If you need a browser enabled. the action within that button rule needs modified to change ".xml" to ".xml?OpenIn=Browser". I forgot to mention two things. 1) on the "formname" field, its value is a translate function... This is needed to ensure that invalid characters in the now() function are converted into something SharePoint accepts. translate(., ' ~#%&*{}<>:?\/|"+.[]…', "____________________") 2) The formname is initially set for a new form with a 'form load' rules with the condition of: if formname is blank, then set it to concat("form-", now()) To answer your questions: The URL formula is set within the actions of the button you will click to create the new form and its link to the old one. The same button that you click to create the new form also sets the new formname (It's formula is the same as was used initially). concat("form-", now()) Save the form I included, and modify the data connection to a test site you have, and publish the form to a new form library. If all goes correctly, Open the form and click on the Submit button Then from SharePoint, open that new form, and then click on the 'Create new form and link to the old form' button.
    Laurie Wheeler
  • 08-13-2018 08:03 AM In reply to

    Re: Linking to a previous form in a Form Library

     Thanks Laurie. That's very kind of you. I'll take a look t your example

  • 08-14-2018 07:21 AM In reply to

    Re: Linking to a previous form in a Form Library

     Laurie. Would this work for previous forms which have been created? I've got around 5 test forms and I don't think this would give me the option to select one of those?

  • 08-14-2018 07:27 AM In reply to

    Re: Linking to a previous form in a Form Library

    It's going to be a going forward thing. So, once you modify a forms structure, then there after this new function will work. Would be hard to connect 'current' forms to existing 'old' forms, where they already exists. If they are in different SharePoint libraries, you might have to get creative with the URL by hard coding it into that formula instead of using the SharePointSiteURL() function.
    Laurie Wheeler
  • 08-14-2018 07:31 AM In reply to

    Re: Linking to a previous form in a Form Library

     Thanks

Page 1 of 1 (9 items)
Copyright © 2003-2018 Qdabra Software. All rights reserved.
View our Terms of Use.