Manager AD info missing when editing record. - InfoPath Dev
in

InfoPath Dev

Manager AD info missing when editing record.

Last post 08-24-2017 04:21 PM by Hilary Stoupa. 12 replies.
Page 1 of 1 (13 items)
Sort Posts: Previous Next
  • 08-23-2017 09:10 AM

    Manager AD info missing when editing record.

    I created two data connection to pull in the manager’s name of the person in the people picker on an infopath form. The form works fine on a new entry. When I edit the record I get an error querying a data source and the manager’s username and Preferredname is removed. I’ve searched with no avail to find the answer. I have to reenter the person in the people picker to get it pull again. Thanks in advance for any help.
  • 08-23-2017 04:59 PM In reply to

    Re: Manager AD info missing when editing record.

    Is this a customized list form? Or is it a regular form? When do you run the data connections and set the fields?
    Hilary Stoupa

  • 08-24-2017 07:28 AM In reply to

    Re: Manager AD info missing when editing record.


    Thanks for your response. I’m a newbie to SharePoint/InfoPath, but I’m learning!!!


    It is a customized form in InfoPath. It queries on field change. This field shouldn’t change as the person in the picker doesn't change in view or edit. My thoughts were that it would re-query ensuring that the correct manager would display if changed. The error only occurs when you view/edit a record that has someone selected in the picker and does not error if the picker is blank.


    To explain what I’m trying to accomplish. I created a list of available training classes. Each class has a limited number of seats that are on a list as a record, with the class name and dates and the people picker is blank. The manager then edits the record of the available class they would like to assign their employee to. I wanted it to display the mangers info as a reference to ensure that they are enrolling the correct employee, which is an issue as we are a very large company with employees with the same name.

    BTW, This is an awesome forum...

    Thank you 

     

  • 08-24-2017 08:06 AM In reply to

    Re: Manager AD info missing when editing record.

    Any chance I could see your template? That would help me set up a repro.... You can attach it under the Options tab in a reply.
    Hilary Stoupa

  • 08-24-2017 08:30 AM In reply to

    Re: Manager AD info missing when editing record.

    Sure, example attached.


    Thanks,


  • 08-24-2017 09:20 AM In reply to

    Re: Manager AD info missing when editing record.

    Thanks, I'll take a look later today or tomorrow AM and see if I can figure out what's up (or a work around!)
    Hilary Stoupa

  • 08-24-2017 10:11 AM In reply to

    Re: Manager AD info missing when editing record.

    So - looking at this, a couple things I would try right off - for your rules on EmployeeName, only run those if EmployeeName is not blank. Then, instead of using defaults for Manager / Manager Name, set the fields via rules on the EmployeeName field after you run the query.... Does that make sense? You could also add rules to EmployeeName to clear those fields (Manager / Manager Name) if EmployeeName is blank.
    Hilary Stoupa

  • 08-24-2017 12:39 PM In reply to

    Re: Manager AD info missing when editing record.

    I tried what you suggested but I got something messed up and not sure how it worked originally. The Manager field pulls in the managers acc# but I can’t seem to get the manager PreferredName in the Manager Name field. It fills with the person selected in the picker PreferredName. I’m not sure how to get it to pull the managers PreferredName. Attached is the template.

    Thanks for your help.

     

  • 08-24-2017 02:31 PM In reply to

    Re: Manager AD info missing when editing record.

    Ah - I hadn't looked very closely & didn't realize you were running additional rules on the Manager field. Try this copy. Save it locally, right click & select Design to open in Design mode.
    Hilary Stoupa

  • 08-24-2017 03:26 PM In reply to

    Re: Manager AD info missing when editing record.

    That was it. No more error. Thank you so much.

    It looks like you added a rule to set field value “AccountName” with a value “=Manager” before the query. Was that the only issue? I put in a rule to do that but I put it below the query.

    I still have to add the rules to clear those fields when Employee Name field blank.

    Thanks again for your help.


  • 08-24-2017 04:07 PM In reply to

    Re: Manager AD info missing when editing record.

    So - yes, I added that, and I also modified the formula for setting the Manager field - you were setting it using the Get Manager query, when I think you already had that data from the user profile query. For setting query fields, we always set them BEFORE we execute the query, because they impact what data is returned. We are saying: "SharePoint - Fetch me the manager data for this specific user!" by setting the account name query field then executing the query. If we set the query field after we execute the query, SharePoint (or whatever the data source is) has no idea what we want.... :)
    Hilary Stoupa

  • 08-24-2017 04:15 PM In reply to

    Re: Manager AD info missing when editing record.

     I'm learning!!!

    Thanks you for explaining. 

  • 08-24-2017 04:21 PM In reply to

    Re: Manager AD info missing when editing record.

    That was one of the hardest parts for me - learning the right order of operation for rules & learning XPath filtering. What really helped me was dragging all the fields for data sources onto the form (you can clean up the form before you publish) and adding buttons to query the data connections. Then I could experiment with setting different values, running queries, and seeing precisely what data is returned. :)
    Hilary Stoupa

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