Max(@ID) no longer working - InfoPath Dev
in

InfoPath Dev

Max(@ID) no longer working

Last post 05-27-2009 01:30 AM by alc1854. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-25-2009 07:13 PM

    Max(@ID) no longer working

     Hi all,

     

    I'm not sure what has happened here.
    I had an Infopath form which was retrieving the latest ID number from a Sharepoint list to use it in new forms.

    When I click to submit the form, it queries the list, grabbing the @ID field.
    It then assigns Max(@ID) +1 to a text field and submits the form using the text field as the file name.

    I got up to form 191, and now all forms are overwriting form 191.

    I've created a test Form, just to retrieve the ID field and display it to a text box.

    The max(@ID) function is bringing back 190 each time, even though the list definitely has 191 entries.

    I have even uploaded a document manually, and there are now 192 forms in the list, and the ID field says 192.
    The max(@ID) function still states 190.

    Any ideas of what is happening?

    Filed under: ,
  • 05-25-2009 08:30 PM In reply to

    Re: Max(@ID) no longer working

    can you confirm the Library you get the max ID is same with your sharepoint list?

  • 05-25-2009 08:56 PM In reply to

    Re: Max(@ID) no longer working

    Yes, it is the same list, because item number 191 changes on that list whenever I submit a new one.

    For some reason, the Data Connection cannot see that there is actually 191 items in the list. It only counts 190.

    Is there a limit on how many items a data connection can grab?

    Or is the Max() function limited to 190?

  • 05-25-2009 10:49 PM In reply to

    Re: Max(@ID) no longer working

    OK, I have made a little headway.

    It is working again, but it has only opened a few more questions.

    I changed the default view settings in Sharepoint to have an Item Limit of 1000 (Instead of the default 100)
    This seemed to fix the issue.

    I do not know why the limit should affect this at all.
    And, why did it work up until 190 when the limit previously was 100? Should it not have stopped at 100?

    Why would the limit even affect a data connection? I would think it should also ignore the default view, and just look up the entire list.
    And, what if I want the default view to be empty?
    Does that mean the whole data connection thing would not work at all?

    Can anyone confirm how both the Data Connections and Max(@ID) options actually work? What are the limitations? Are there better ways to do it?
    Does anyone know of any code that would do a better job?

  • 05-27-2009 01:30 AM In reply to

    Re: Max(@ID) no longer working

    I have encounter the same thing before, I think you don't change the default view, and make sure the default view can get all form. if you want open the list with empty ,just create a new view you wanted and place this URL at quick launch.  and same time set the "

    Display this form library on the Quick Launch
    "  to no

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