Data connection to generate =max(@ID)+1 form number inhibiting performance - InfoPath Dev
in

InfoPath Dev

Data connection to generate =max(@ID)+1 form number inhibiting performance

Last post 03-06-2012 05:00 PM by s3ttt. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-06-2012 04:17 PM

    • s3ttt
    • Not Ranked
    • Joined on 03-06-2012
    • Posts 4

    Data connection to generate =max(@ID)+1 form number inhibiting performance

    Background: This form library is large.  Users enter a high number of forms in a row many times a day.  Within 1 year you can expect to have about 8,000 records, which then closes the library.  Because of the large number of records, the default SharePoint view for the list needs to be grouped and limited to only recent records.  I do prefer to simply use now() as a unique form identifier; however, because of the frequency of use the form number was added for readability and to ensure there were no duplicates from now().

    Originally I simply made a data connection using max(@ID)+1, but this stopped working or was having issues with the grouped view.  I made a custom form number view using an XML data connection http://blogs.msdn.com/b/infopath/archive/2007/01/15/populating-form-data-from-sharepoint-list-views.aspx to a custom list view.

    However, now my form is having performance issues.  It takes approximately 50 seconds for a form to open where as before it was taking around 8.  This now makes the form unusable. 

    The form number appears in a field when the form is opened and not just when the form is submitted.  

     

    I must use a codeless solution.  The form number CAN be random and form numbers don't need to go in numerical order...although that's nice.  Am I left with formula options like counting the characters in someone's name and then dividing now by that number to generate a random number?

     
  • 03-06-2012 05:00 PM In reply to

    • s3ttt
    • Not Ranked
    • Joined on 03-06-2012
    • Posts 4

    Re: Data connection to generate =max(@ID)+1 form number inhibiting performance

    I would still like to know if anyone has any thoughts on why this type of data connection so significantly decreases performance...but I came up with a half workaround by completely eliminating the data connection.  

    Here was my formula to generate a random number.

    Step 1:  number(concat(substring(string(today()), 6, 2), substring(string(today()), 9, 2)))

          This formula will return the month and day so 3-06-2012 is returned as a number (not a date) as 306.

    Step 2:  string-length(CreatedBy) * Step 1

          This formula multipled the previous monthday number by the number of characters in someone's name.

    I then would have to save the file by the new form number + now().

    I'm going to keep working on Step 2 to perhaps multiply that number by another field of random length so that the same person on the same day won't have duplicate form numbers.  

    Any ideas?

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