Submitting a form with a new name + Copying data between columns in a repeating table - InfoPath Dev
in

InfoPath Dev

Submitting a form with a new name + Copying data between columns in a repeating table

Last post 07-03-2012 04:05 PM by Hilary Stoupa. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 06-26-2012 11:50 AM

    Submitting a form with a new name + Copying data between columns in a repeating table

    Hello.

    TLDR:

    1. After the form is submitted under a new name, a popup appears asking if I would like to overwrite the old report. How do I suppress this popup.
    2. Can 'Save As' be applied as an action via rules?
    3. How does one copy data from one column to another within a repeating table without adding code.

    I am relatively new to infopath. I have InfoPath 2010 installed. I do not have Visual Studio Tools for Applications [VSTA] installed (but I do not know how to code anyway).

    I am designing a form for Monthly Project Reporting.

    I created a Form Library in SharePoint called 'Projects' where one (1) 'Project Information Form' form is saved for each project we would like to report on. One (1) of the fields in the 'Project Information Form' is 'PID' [Project ID] and is unique to the given project.

    I created a Form Library in SharePoint called 'Monthly Reports' where I would like to store the 'Monthly Project Report Forms'.

    Most information between subsequent 'Monthly Project Report Forms' is identical, so Ideally it will be preserved when preparing the next monthly report.

    For the purpose of maintaining through documentation, it would be ideal to save a new instance of the report with the new month and/or report number in the name it is saved under, and not to overwrite previous reports for a given project.

    I do not know how to copy data between infopath forms, so I did the following:

    I created a numeric field, report number to count reports for me. On a new form it is set to 1 by default. Forms are named "<PID> - <Report Number>" on submit.

    I created a button labeled 'Prepare form for next report' which increments the report number, copies the data in [non-repeating] fields labled 'current period' to those labled 'previous period' then sets the values for the 'current period' to all blanks for the user to fill out. Fields not associated with a particular reporting period are preserved. [Fields labled previous reporting period are disabled so that users cannot edit them. the data is retrieved/ computed from previously entered information]

    Issue 1: 

    What I want to see happening is:

    1. User submits project information via a new project form
    2. User submits the first monthly report via a new monthly reporting form. 
    3. User opens the previous reporting form from previous reporting period. Uses the 'Prepare form for next report' button to move data between fields and clear required space. User fills remaing fields and submits the form. Since the button increments the report number, the form is submitted with a new name.
    4. If project Is finished quit. Else return to step 3.

    This all happens, but after the form is submitted under a new name, a popup appears asking if I would like to overwrite the old report. I dont. I dont even want to see that pop up. End users will be able screw up old reports unintentionally if they get that option. This popup appears regardless of whether the checkbox to allow overwrite is filled or not. If I could add a rule to save the file under its new name before submitting this problem could be avoided. Can one implement 'Save As' as an action via rules without code?

    Issue 2:

    The monthly report includes a repeating table for Project Milestones.

    A project manager can enter as many milestones as he likes. For each milestone we store the following fields in a repeating group named MilestoneRepeater.

    1. MilestoneNumber [count(preceding-sibling::my:MilestoneRepeater)+1]
    2. Name
    3. BaselineIn-ServiceDate
    4. CurrentReportingPeriodForecastIn-ServiceDate
    5. PreviousReportingPeriodForecastIn-ServiceDate
    6. Actual In-Service Date
    7. Comments

    The entire column of controls under PreviousReportingPeriodForecastIn-ServiceDate are disabled. These fields should only be populated by the 'Prepare form for next report' button, which I want to copy the data from each of the CurrentReportingPeriodForecastIn-ServiceDate fields to the PreviousReportingPeriodForecastIn-ServiceDate field on the respective row.

    I thought that using the following action rule would work:

    'When button is pressed.
    Set A fields Value.
    Field: PreviousReportingPeriodForecastIn-Service Date 
    To: CurrentReportingPeriodForecastIn-ServiceDate[MilestoneNumber=position()]

    However, all the PreviousReportingPeriodForecastIn-ServiceDate fields are set to what had been entered in the first CurrentReportingPeriodForecastIn-ServiceDate. Thus I lose most of the data.

    How does one copy data from one column to another in a repeating table?

     

    Thanks for your time spent reading my long plea for help and for any help you can provide.

  • 07-03-2012 04:05 PM In reply to

    Re: Submitting a form with a new name + Copying data between columns in a repeating table

    Hi - item 1 sounds like odd behavior to me - if your submit is going to create a new name, you shouldn't be getting messages about overwriting - is this a browser form? Or filler? If a browser form, there will be a save location in the URL that may be causing you issues.

    Item 2 - no

    Item 3 - the issue may be where your rule is - if it was on a field in the repeating group, it would set the individual fields - see attached sample (save locally, right click, select Design and preview). Oh, and make sure position() is returning what you think it is....in my sample, I'm using a count of preceding-siblings....

     

    Hilary Stoupa

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