GetUserProfileByName issue - InfoPath Dev
in

InfoPath Dev

GetUserProfileByName issue

Last post 10-05-2010 08:02 AM by jeffdo. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 09-29-2010 08:23 PM

    • jeffdo
    • Not Ranked
    • Joined on 09-23-2010
    • Posts 2

    GetUserProfileByName issue

    Hi, I am fairly new to Infopath. I created a form in Infopath 2003 that is basically a checklist that will get published to a SharePoint forms Library.  It's a simple form, I have a drop down box with 3 choices for the user to select (success, failure, other) a field for the time of choice and a user name field.

    I was using this article as a reference. http://blogs.microsoft.co.il/blogs/itaysk/archive/2007/04/05/InfoPath-_2D00_-Get-the-current-user-without-writing-code.aspx

    I created two filter conditions, the first being "choiceBox is not blank and" "name is equal to AccountName" and published the form to SharePoint.

    This worked great for me, once my user chose something in the drop down for the form it populated his AccountName in the user field as I intended it to. 

    But...once he saved the form and a second user opened it, immediately each of the places where the first users AccountName had been displayed changed to the second user.

    I'm not sure if my problem is from the logic of the filters, if it is beyond the scope of polling the web service. I did try to add a third filter thinking that if I put a third conditional that said "UserField is blank" it would bypass and do nothing when the form was reloaded because it was already populated. Unfortunately doing that gave me a too many calculations error and nothing was populated.

    Is what I am trying to do beyond the scope of using a web service and I should try to implement the active directory polling instead or is my understanding of how this works flawed? 

    Thank you,

    Jeff

     


  • 10-05-2010 03:54 AM In reply to

    Re: GetUserProfileByName issue

    This is fairly simple and will always be something you need to do when a secondary person will open the form. You need to do the following :-

     Create a variable such as 'ReadOnlyMode' and set the default value to 'No' (or make it a boolan - your choice)

     On form open, set the condition on which the 'GetUserProfileByName' action is called when the 'ReadOnlyMode' is equal to 'No'

     Where you have the form submit set the variable 'ReadOnlyMode' to 'Yes'

    Once the form is opened a second time then it should not re-query the GetUserProfileByName function.

     Jason.

  • 10-05-2010 08:02 AM In reply to

    • jeffdo
    • Not Ranked
    • Joined on 09-23-2010
    • Posts 2

    Re: GetUserProfileByName issue

     Thanks for responding. I need to actually look up the user information for 4 users in the form. The form is a 24 hour checklist where each shift would open it for their 8 hours, mark if their tasks are in failed/success and then save the form for the next shift to take over.

     The last step is a supervisor opens the form, validates what was done over the 24 hour period and also adds his user id at the end.

     If I disable GetUserProfileByName at form open, won't that prevent the rest of the users from having their user info displayed at their tasks?

    Would having the procedure query the web service at each line item work instead and not actually querying at form load? I assume that is possible but not sure how that works?

     

     

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