Auto-numbering InfoPath forms when they are submitted to a SharePoint form library - InfoPath Dev
in

InfoPath Dev

Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

Last post 02-02-2012 08:59 AM by jaxkookie. 7 replies.
Page 1 of 1 (8 items)
Sort Posts: Previous Next
  • 01-19-2012 04:53 PM

    Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    I tried to implement this:

    http://www.bizsupportonline.net/browserforms/autonumber-infopath-form-submitted-sharepoint-library.htm

    BUT when I go to my library and open the form, fill it out, and click SUBMIT.... I get an error! In SharePoint it says I don't have permission to access the library and then in the event log it says:

    The following query failed: RetrieveNum (User: me, Form Name: QI, IP: , Connection Target: , Request: http://mysite/_layouts/FormServer.aspx?XsnLocation=http://mysite/FormServerTemplates/QI.xsn&SaveLocation=http://lp298/QI&ClientInstalled=false&Source=http://mysite/QI/Forms/AllItems.aspx&DefaultItemOpen=1, Form ID: urn:schemas-microsoft-com:office:infopath:QI:-myXSD-2012-01-16T19-50-48 Type: DataAdapterException, Exception Message: The form cannot run the specified query. The list could not be found.)

    HELP I don't know what went wrong or what I have to do... I followed that blog to a TEE (well I may have changed some of the field names but the procedure is the same)

    Any thoughts?

  • 01-19-2012 06:44 PM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    Hi:

    You might want to check your permissions for that library. You should have at least contribute access with read/write/edit permissions.

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 01-20-2012 08:38 AM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    I just added these permissions to my account: Full Control, Design, Contribute, Read, Limited Access, Records Center Web Service Submitters. I can check and uncheck all of those options except for Limited Access, that box is checked and grayed out so I can't uncheck it. I then tried to submit the form but I still get the error. As far I know, my account should have the most permissions since I created the site on my machine. I don't know what I am missing..
  • 01-20-2012 11:33 AM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    Okay, so I ditched the idea of getting the info from the library and instead used managed code and am using a stored procedure in our SQL database to retrieve an auto-incrementing field that resets on the new year :) this has the added benefit that you don't need to worry about having permissions to get into libraries and such PLUS the database has its own locking format so even if two people click submit at the exact same time and the code retrieves the number at the same time, they get different numbers :D infopath is nice.. but it seems you can do SO much more and WAY easier if you use custom code...
  • 01-30-2012 12:08 PM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    azandbergen you are correct about doing more with managed code. InfoPath is a foundation tool. It lets you build a foundation that can be built off of. If you think about the amount of effort to build an asp form with a repeating section, InfoPath far exceeds. I have recently started using stored procedures to generate auto numbering. I wound up using the SP Item ID because I could not solve for duplicate submissions and users getting the same ID. I would interested in knowing how you sloved for that.

    Kind regards,
    Larry
  • 01-31-2012 01:29 PM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    Like I said, I ditched the method of looking up the SP item ID's from the library and getting the max ID. I was having problems with library permissions so instead of using data connections and rules, I went the managed code route and in the code, I make a call to a SQL stored procedure wherein it pulls from a table a "job number". This job number starts at 1 and keeps going and auto resets on the new year. I'm not familiar with the details on how it resets or how it guards against duplicate numbers - someone else managed that part I simply made a call to his stored procedure he made. I will find out though and get back to you
  • 01-31-2012 01:38 PM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    Okay I chatted with him and this is what happens: when I call the stored procedure, it takes in the current user and the current year. The lock is the user name - if the lock is free then it sets the lock to the user name, if another form calls the procedure, it sees that the lock is set to another user, so it waits until it is free. The other form will release the lock when its done and exits. It resets on the new year via the passed in year. the table value has the counter and the year. it checks to see if the year passed in matches any years in the table, if it does then it increments the next number. if its a new year, it sees that there are no entries for the year so it starts at 1. It's a very simple, rudimentary solution but it works for us and you don't have to deal with sharepoint library permissions, we just use a sharepoint SQL server user that has access to the appropriate tables and use that user in the connection string.
  • 02-02-2012 08:59 AM In reply to

    Re: Auto-numbering InfoPath forms when they are submitted to a SharePoint form library

    thanks for the update

    Kind regards,
    Larry
Page 1 of 1 (8 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.