Hiding section on form with Approver only view - InfoPath Dev
in

InfoPath Dev

Hiding section on form with Approver only view

Last post 12-04-2015 02:01 AM by Jerry O'Neill. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-03-2015 08:56 AM

    Hiding section on form with Approver only view

    Hi

    I am trying to create a form on Infopath with an Approval function. The inputter completes the form and then selects an approver from a list to submit the form for approval. I have created a section that contains two fields for the Approver to complete, one to approve the form, the other for information purposes. As I would like only the approver to see these fields I have hidden them in a section.

    I have two formatting rules one to hide the section. The first hides the section if the form is unsubmitted which works fine. The other is the source of my problem. I am trying to make sure the person viewing the form is the authoriser so I've used the formatting rule "userName()=!Approver" with the "Hide this control" option ticked. When the selected approver accesses the form the section stays hidden. Any suggestions would be gratefully received. 

     

     

  • 12-03-2015 12:08 PM In reply to

    Re: Hiding section on form with Approver only view

    I don't where you are getting the "Approver" from your text, so I assume you are getting the approverID from a list or somewhere to populate your "approver list."

    Make sure you are comparing the username() to the approver ID and not their actual name.

    One thing I do is to force all comparisons of userName() to lowercase using the code below.

    Also check to see if you are using the domain name as "domainName\userID."  If you are, then you may need to concat the domain name to username() before you compare.

    For my example, I will use "[APPROVER_ID_FIELD]" as the pseudo fieldname where the approver ID you would get from the list is stored.

    translate([APPROVER_ID_FIELD], "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz") = translate(userName(), "ABCDEFGHIJKLMNOPQRSTUVWYXZ", "abcdefghijklmnopqrstuvwyxz")

    Hope this helps a little.

    Ray

     

    P.S.

    Often I actually store the lowercase version in a "userIDlc" field at form load if I know I am going to compare the "current user" to several different scenarios such as Approver, ServiceCoordinator or Admin, where each serve different functions within the form.

    Cheers.

     

  • 12-04-2015 02:01 AM In reply to

    Re: Hiding section on form with Approver only view

     That's a big help. Thannks Rayzermatic.

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