Get Max ID of List > 5,000 threshold - InfoPath Dev
in

InfoPath Dev

Get Max ID of List > 5,000 threshold

Last post 06-27-2017 09:42 AM by meissen. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 06-20-2017 07:39 AM

    Get Max ID of List > 5,000 threshold

    Hi all,

    My InfoPath solution is only ~5 months into production and we've already hit the 5,000 list view threshold. Part of the steps for submitting the InfoPath form to SharePoint refreshes a query of the SharePoint list to get the max ID (similar to the auto-numbering File ID concept)... Only problem is that said list has now grown to over 5,000 entries and refreshing causes the SOAP error that I've exceeded the list view threshold.

    So now I'm stuck -- how do you get the max ID of a list when the number of entries exceeds the threshold?

    I was thinking I could tell it just to return the top 1 record, sorted by ID in descending order... Or maybe filter the query by today-7 so it only returns records that are a week old...? But if I'm not sure how to implement that.

    All things considered - if I've hit 5,000 entries in ~5 months ... does it sound like I should stick with SharePoint lists or would it be more beneficial to rewrite the datasources for the InfoPath file and use SQL server instead?
  • 06-26-2017 08:16 AM In reply to

    Re: Get Max ID of List > 5,000 threshold

    Wow - yeah, it does sound to me like this data collection may be better suited to SQL than SharePoint, just because of the mass of data. However, as a work around, maybe you could use a REST query? That would give you much better filtering options. Be sure to add indexes to your list / library columns to improve performance, and talk to your SharePoint admin about increasing the threshold.
    Hilary Stoupa

  • 06-27-2017 09:42 AM In reply to

    Re: Get Max ID of List > 5,000 threshold

    Thanks Hilary. I've been able to get around the max ID issue by creating a workflow in SharePoint which increments a record in a different table which keeps track of the max ID. Then InfoPath only has to query the one record from the "supporting table" to get the max ID and autonumber accordingly. Hopefully we'll see a slight performance boost in the code execution doing it that way rather than querying the ~5000 record list.
Page 1 of 1 (3 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.