GetUserProfileByName populating name change on View Switch - InfoPath Dev
in

InfoPath Dev

GetUserProfileByName populating name change on View Switch

Last post 10-16-2013 06:43 AM by Hilary Stoupa. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 10-15-2013 05:40 PM

    GetUserProfileByName populating name change on View Switch

    Hi everyone, got somewhat a bit of a complex issue and not sure how to resolve it. Was hoping someone could point me in the right direction

    My situation is that I am using the GetUserProfileByName web service to populate submitting user details on a form. Works great and doing what it needs to do when a user submits a form. But I have noticed when the form has been submitted and is required to be approved, the web service changes the populated name to the user who is approving the form, not the one who initially submitted it.

    So my question is, is it possible to to make the submitting user details static on the following approving form? I really cant use this function if it keeps on changing to whoever is approving the form.

    Many thanks

  • 10-15-2013 06:23 PM In reply to

    Re: GetUserProfileByName populating name change on View Switch

     My guess here is that you are using a default value that uses your secondary data connection. And that the data connection queries on load, so it will always have the name of the person opening the form.

    Instead, use a form load rule and add a condition to it so that the user details only get set the first time the form is open. Let's pretend you have a field in the main data source of your form called UserEmail. You could add a form load rule that checks to see if UserEmail is blank, and if it is, set the field to the value from the User Profile web service.... Does that make sense?

    Hilary Stoupa

  • 10-15-2013 06:35 PM In reply to

    Re: GetUserProfileByName populating name change on View Switch

    Hi again Hilary, our resident guru! :)

    As guessed, yes I am using the default value and from here grabbing the secondary data source and filtering the values for the fields PreferredName, Title and WorkEmail.

    Funny you mention the form load rule, I did initially had one when I was using the people picker control, but changed it to text boxes/default values option in design so disabled it.

    I'll give it a crack and see how I go... 

    Cheers

  • 10-15-2013 08:05 PM In reply to

    Re: GetUserProfileByName populating name change on View Switch

     As expected, you were right Hilary!

     Thank you once again!

     

  • 10-16-2013 06:43 AM In reply to

    Re: GetUserProfileByName populating name change on View Switch

     Do be very careful with default values - sometimes they are exactly what you want, sometimes not. For example, if you had an Invoice form with a secondary data connection that had items and their prices - if you use default values for price and the price changes - what happens when you re-open an old invoice? Most likely, the price gets updated to the latest info and now all of a sudden your invoice has inaccurate info - 'cause you didn't charge 16.19 for that item back when it was created. :)

    Glad you have it sorted!

    Hilary Stoupa

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