How to get fields forever locked once filled in - InfoPath Dev
in

InfoPath Dev

How to get fields forever locked once filled in

Last post 08-04-2014 04:06 AM by pengel. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 07-31-2014 01:25 AM

    • pengel
    • Not Ranked
    • Joined on 07-31-2014
    • Tilburg
    • Posts 2

    How to get fields forever locked once filled in

    Hi guys, hope you can help me out with an issue...
    I'm not quite a newbie on InfoPath, but this time I ran into a issue I can't solve. So help me out please :-)

    Issue Description/Background Information 

    1. A Data Connection string has been configured to pull Get User Profile.
      This Data Connection is used to set several field values in the form, like: PreferredName, CellPhone, WorkPhone and Manager.
      Tested and Data Connection works quite fine
    2. Once the form is loaded from a Form Library in SharePoint 2010, three FORM LOAD rules will run to set the Field Value's mentioned above.
      Condition for those rules are, if the field is blank, run the rules
      Those rules don't work properly...

    Target

    I would like to achieve the following: Once the form loads, the creators name must be set (as well the CellPhone/WorkPhone/Manager) values.
    So when the form has been submitted and will be opened by another user, those fields mustn't change.

    So finally, I would like to lock those fields forever. The FORM LOAD rules don't work properly....

     Thank you in advance!  
    Kind regards from The Netherlands 

    Filed under:
  • 08-03-2014 09:16 PM In reply to

    Re: How to get fields forever locked once filled in

     Hello from The USA!

     What you need is a new True/False Boolean field in the form. For the purposes of my explanation, let's call this field Locked.  The default value for Locked should be FALSE.  Now, add a rule to your Submit button that sets Locked to TRUE when the button is clicked (i.e. no condition).

     Now for each field you want locked forever, add a calculated value control and bind it to the field.  So for each field, you will now have two controls bound to it: the one you already have created, and the new calculated value.  For each of your existing controls, add a formatting rule with the condition Locked is equal to true(), and check the "Hide this control" checkbox.  For each of the new calculated value controls, add a formatting rule with the condition Locked is equal to false() and check the "Hide this control" checkbox.

     So, as long as Locked is equal to FALSE, the original calculated value controls will be hidden and your original controls---which are editable by the form user---will be displayed.  Then once the user clicks the Submit button, Locked is set to TRUE, and the next time the form is opened the calculated value controls (which are not editable) will be displayed and the original editable controls will be hidden.

     Let me know if this makes sense.

    Jennifer Lindsay
    Qdabra® Software/InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™

  • 08-04-2014 04:06 AM In reply to

    • pengel
    • Not Ranked
    • Joined on 07-31-2014
    • Tilburg
    • Posts 2

    Re: How to get fields forever locked once filled in

     Hi Jennifer,

     

    thank you for replying! Your solution makes sense. 
    But one issue resists: When I submit the form, the end-validationcheck displays an error about the required LockField (it is cleared when I open the form).

    When I submit, the first rule on the button is set the value of the lockfield... And the second rule is the submit connection. So the Lock field gives the final error of required...

    Thanx in advance and kind regards! 

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