max(@ID) issue - InfoPath Dev
in

InfoPath Dev

max(@ID) issue

Last post 02-11-2013 01:58 PM by SeanPRyan. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 01-31-2013 05:21 AM

    max(@ID) issue

    I created a form that when linked with SharePoint should increase the name value by 1 each time.  Here is everything I have setup.

    1.       Autonumber field
      a.       Rule 1                                                              
              
    i.     
    No Condition                                                            
              
    ii.     
    Rule Type – Action                                                          
              
    iii.     
    Run these actions
                1.       Query using a data connection
                     a.       Data connection = Received ID
                2.       Set a fields value
                     a.       Field = Autonumber
                     b.      Value = max(@ID) + 1
               3.       Submit using a data connection
                     a.       Data connection = SharePoint Library Submit

    2.
          
    Data Connections
        a.       ReceivedID                                                              
                  
    i.     
    Location of SharePoint site is correct                                                            
                   
    ii.     
    The library is correct                                                           
                   
    iii.     
    SharePoint list field selection = ID
       b.      SharePoint Library Submit                                                              
                  
    i.     
    Document Library is correct                                                             
           ii.     
    File name:
                   1.       concat(max(@ID) + 1, Consumer_Last_Name, "_", Specialist_Name, "_", "Sensitive")

    That is everything I have setup on my form.   Here is an example of what I’m getting.

    ID Name
    59 59-…
    60 59-…
    61 60-…
    62 60-…
    63 60-…
    64 60-…
    65 60-…
    66 60-…
    67 60-…
    68 68-…
    69 69-…
    70 70-…
    71 70-…
    72 70-…

    And now, I made a change to the form published it back out there and the form name reset to 140.

    ID Name
    2002 140-…
    2001 140-…
    2000 140-…
    1999 140-…
    1998 140-…
    1997 140-…
    1996 140-…
    1995 140-…
     

    Can anyone help me figure out what I’m missing.  I need to get the name field where it is submitting correctly.  I need it to be the ID + 1 at the beginning of the name.

    Thanks

     

    Filed under:
  • 01-31-2013 01:08 PM In reply to

    One more thing I noticed, when a user tries pulling up a new record, they receive this error.

     

    InfoPath cannot submit the form.The form was not submitted because a form named 140__Sensitive.xml already exists in the document library at website_x. Please contact the provider of the form.

     

     

  • 02-11-2013 01:58 PM In reply to

    • SeanPRyan
    • Top 200 Contributor
      Male
    • Joined on 02-02-2012
    • Kansas City area
    • Posts 62

     I don't know if this will help but my unique filename looks like this:

    concat("MyForm", SomeField, max(@ID[. > 0]) + 1)

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