Submitting a form to SharePoint library creates two files with different file names - InfoPath Dev
in

InfoPath Dev

Submitting a form to SharePoint library creates two files with different file names

Last post 12-12-2008 04:02 AM by Anonymous. 2 replies.
Page 1 of 1 (3 items)
Sort Posts: Previous Next
  • 12-11-2008 06:50 AM

    Submitting a form to SharePoint library creates two files with different file names

    I have made three forms in InfoPath to use in SharePoint, all of them with the same rules and data connections.  Two of them work just fine, but I am having trouble when submitting my form for Travel Expences, which is the largest and most complex of them.


    Background:
    My form automatically creates  a filename when it is submitted the 1st time, and does not change this filename if it’s opened and adjusted later.
     I have solved this by having one field for the author’s initials, and one ItemNo field which is populated on the 1st Submit. 
    On opening the form I made a rule to keep the ItemNo if the value is larger than 100.
    I have made one data connection to retrieve the Accounting Library’s ID and two data connections for submitting the form.

    I have two Rules for submitting my form
    Rule 1: If ItemNo is empty
    a)    A data connection query to receive ID from the Accounting Library
    b)    Insert  formula:      ItemNo = 1000 + max(@ID) + 1
    c)    Submit using data connection:  Submit 1st time to library
    The filename for submitting the form is:   concat(today(); " "; initials; " Travel "; 1000 + max(@ID) + 1)

    Rule 2:  if ItemNo is larger than 100
    a)    Submit using data connection:  Submit 2nd time to library
    The filename when submitting 2nd time is:  concat(today(); " "; initials; " Travel "; ItemNo)

    Problem:
    Most often when submitting the form the first time (using a submit button), it creates two almost identical items – only the filename differs – and then comes the message that the item is sent and the prompt for ok. In the Library the two forms have the same date and time and they have identical ItemNo. But their filenames differ:

    2008-12-11 SO Travel NaN.xml
    2008-12-11 SO Travel 1057.xml

    Can it be that the query needs a little pause for the ItemNo field to be populated, and if so, how do I do that (I don’t know any programming)

    I hope someone has an answer for me

    Toril

  • 12-11-2008 08:06 PM In reply to

    Re: Submitting a form to SharePoint library creates two files with different file names

    Hi,

    The rules will execute in the order they have placed. So in rule1 you are calculating the item no. So after finishing the first rule the Item no is some 10001 or above.

    The in second rule it is checking whether the Item no is larger than 100 or not which is true. So again this is also submitting the form. Because of this the form is submitting twice.

    To avoid this Place the Rule2 first and Rule 1 second.

    Hope you understood.

    Swathip
    www.ggktech.com
  • 12-12-2008 04:02 AM In reply to

    Re: Submitting a form to SharePoint library creates two files with different file names

     

     Hi,

    Thank you for your answer, my prolem is solved. 

    I switched the two rules as you suggested and kept only the 2nd data connection (creating the filename:  concat(today(); " "; initials; " Travel "; ItemNo). My form creates only one file now, as it should, and with a correct filename.

    Toril

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