Set the User Role in second infopath form from initial form stored on Sharepoint - InfoPath Dev
in

InfoPath Dev

Set the User Role in second infopath form from initial form stored on Sharepoint

Last post 02-24-2013 01:19 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-19-2013 04:49 AM

    Set the User Role in second infopath form from initial form stored on Sharepoint

    We have created an HR form to report sickness which restricts the views by using 'User Roles' set to the manager's AccountID when submitted to Sharepoint. Upon submission the form also sends an email to the manager to inform of the absence.

    When the employee returns to work, a second infopath form is populated from the information stored on Sharepoint using the details from the original form. We want to restrict views in the second infopath form to the managers identified in the first form. At present we are populating text fields with the name from the AccountID in Sharepoint but this does not set the User Roles hence the views are not set.

    To control the view, is there a way to set the User Roles from a field which contains only the manager's name in the second form? The field is no longer an email address when submitted to sharepoint. Is there a way convert the text field to an email address to set the User Role to the manager's name? Ideally without using code.

    We are using Infopath and Sharepoint 2010.

    Thanks.

  • 02-24-2013 01:19 PM In reply to

    Re: Set the User Role in second infopath form from initial form stored on Sharepoint

    Yes, but you have to use the domain\username format that User Roles recognize.

    Another approach would be to call User Profile Service and resolve the username based on the user's full name. That might be better because it provides a migration path. Clayton Cobb has a nice post on his SharePoint Madness blog (I think it's his top post).

    User Roles will work if the value is correct, but it will also require that the users be logged in with those accounts.

    Patrick Halstead
    Project Manager at Qdabra
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.