Ensuring unique numbers in InfoPath forms - InfoPath Dev
in

InfoPath Dev

Ensuring unique numbers in InfoPath forms

Last post 05-14-2009 05:54 PM by Patrick Halstead. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 05-14-2009 06:50 AM

    Ensuring unique numbers in InfoPath forms

    I have an InfoPath form that submits to a SharePoint forms library.

    The forms are for tracking invoices and include a generated reference that should be sequential and unique.  The number is based on the department and the highest number so far +1.
    E.g. invoices generated for Finance, IT, Legal, HR, IT would be
    FI000001, IT000002, LE000003, HR000004, IT000005 respectively.

    Currently this works fine; when the form is generated it calculates max(ID)+1 from the existing forms, pads the number with zeroes and prefixes it with the department code.

    Each department now needs to make their invoices visible only to members of their department (using permissions, a view on a list isn't enough).
    The permissions I can do fine using item level permissions in a SharePoint workflow.

    Problem is, in the above example, if Legal were to generate a new invoice then the only existing invoice they'd see would be LE000003, so InfoPath would generate LE000004.  Number 4 is in use by HR though.  The next reference should have been LE000006 but InfoPath can't see 4 or 5.

    Short of making a separate number fountain I can't think of a way to get around this problem.

    Points to either an answer or helpful comments :)
    Thanks in advance

    Ram.
  • 05-14-2009 05:54 PM In reply to

    Re: Ensuring unique numbers in InfoPath forms

    You need to do the increment on the server when the form is submitted and have the form requery the server, get the new ID, and set it in the form. You cna hen concat your 2 char prefix to it and save it.

    This topic is the most-often asked question in this forum. I replied to another person last week. There must be at least two dozen forum threads on this. Have you actually tried to search for them?

    Your personal search concierge,

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