Save multiple documents - InfoPath Dev
in

InfoPath Dev

Save multiple documents

Last post 02-06-2012 12:07 PM by Marzipan. 16 replies.
Page 1 of 2 (17 items) 1 2 Next >
Sort Posts: Previous Next
  • 11-28-2011 07:34 AM

    Save multiple documents

    I have Qrules.  Will update to lates version.

    Create a specification document

    DATA: MetricID from SharePointList
          Unit from SharePointList
          BestPracticeDesc from SQL

    1) Select MetricID from dropdown populated from Sharepoint list

    2) Each Metric has a list of best practices to be populated in a repeating table

    3) On Submit, I want to create a document in a forms library for each unit using the MetricID and Unit in the name.

    I know how to do 1 & 2, can you give me suggestions to #3.

  • 11-28-2011 05:30 PM In reply to

    Re: Save multiple documents

    Hi,

    Which qRules command are you using, or which qRules command did you want to use for this process?

    I might be misunderstanding the scenario, so any additional information is appreciated. Thanks!

    Ernesto Machado
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™


  • 11-29-2011 05:30 AM In reply to

    Re: Save multiple documents

    I am looking for ideas on how to accomplish #3.  I just wanted to state that I had qrules available.

  • 11-30-2011 04:21 PM In reply to

    Re: Save multiple documents

    So - I'm sort of confused about what you are trying to do? If you simply want to fill out the template and submit it to SharePoint, you can use a formula to create the form name - more on that here: http://office.microsoft.com/en-us/infopath-help/submit-form-data-to-a-sharepoint-library-HA010107057.aspx
    Hilary Stoupa

  • 12-01-2011 04:40 AM In reply to

    Re: Save multiple documents

    I would have a secondary data source called unit with 15 items.  I would like to fill out the form and then save it 15 times with the unit name appended to each copy of the document. 

     form1_unit1.xml, form1_unit2.xml, etc.

     

  • 12-01-2011 09:16 AM In reply to

    Re: Save multiple documents

    Oh - Interesting.

    So, I don't even think you'd necessarily need qRules for this.

    But what you do need is to know how many rows there are in your secondary data source, and a way to loop through them.

    I'd have a field (probably in an XML secondary data source) that I'd use for my counter. The rules would be something like this:

    1. Set the counter to the count of the rows from the 2DS (secondary data source).
    2. Copy values from the row that matches the counter into the main data source (i.e. Units/RepeatingRow[number(Util/Counter)]/UnitName)
    3. Set a field's value that you will be using in your submit data connection to the correct name (i.e. concat("PurchaseForm_unit", Util/Counter)
    4. Submit
    5. Set the counter to counter - 1

    So, let's see - the logic from steps 2-5 would need to be on the counter field. You'd want a condition of Counter > 0.

    And then the action to set the counter could be on whatever makes sense in your form.

    Let me know if you need more info or if I've been unclear.

    Hilary Stoupa

  • 12-01-2011 09:35 AM In reply to

    Re: Save multiple documents

    Thanks, that gives me enough to get started.

  • 12-09-2011 10:58 AM In reply to

    Re: Save multiple documents

    Hilary Stoupa:

    Oh - Interesting.

    So, I don't even think you'd necessarily need qRules for this.

    But what you do need is to know how many rows there are in your secondary data source, and a way to loop through tehm.

    I'd have a field (probably in an XML secondary data source) that I'd use for my counter. The rules would be something like this:

    1. Set the counter to the count of the rows from the 2DS (secondary data source).
    2. Copy values from the row that matches the counter into the main data source (i.e. Units/RepeatingRow[number(Util/Counter)]/UnitName)
    3. Set a field's value that you will be using in your submit data connection to the correct name (i.e. concat("PurchaseForm_unit", Util/Counter)
    4. Submit
    5. Set the counter to counter - 1

    So, let's see - the logic from steps 2-5 would need to be on the counter field. You'd want a condition of Counter > 0.

    And then the action to set the counter could be on whatever makes sense in your form.

    Let me know if you need more info or if I've been unclear.

    ..............

    Getting back to this, I am trying to save to a file location.  I know I can use setsave in qrules to set the location, how can I save in a rule?

     

     

     

     

  • 12-09-2011 03:46 PM In reply to

    Re: Save multiple documents

    Oh - yes, I'd made some assumptions, that you would be submitting your forms. There is, to my knowledge, no way to save via a rule. We'll have to consider that for a future qRules add.
    Hilary Stoupa

  • 12-13-2011 07:43 AM In reply to

    Re: Save multiple documents

    Looks like qRules 3.4, which will be released soon, has this feature - a new SaveToPath command.
    Hilary Stoupa

  • 12-22-2011 10:35 AM In reply to

    Re: Save multiple documents

    I have this working except I have 25 units and I get the following error when the interation gets to 16:

    An error occurred in the form's rules or code. The number of rule actions or the number of calls to the OnAfterChange event for a single update in the data exceeded the maximum limit.

    The rules or code may be causing an infinite loop. To prevent this, ensure that the rule action or event handler does not update the data which causes the same rule action or event handler to execute.

    Any way to allow for a greater number? 

     

  • 12-28-2011 02:17 PM In reply to

    Re: Save multiple documents

    Is 25 a set number? Or will it vary? I'm wondering if there may be a way for you to use two counters, one for half the submits, another for the other half....

    Hilary Stoupa

  • 01-02-2012 05:24 AM In reply to

    Re: Save multiple documents

    The number of units would vary. 

    I have set the form up so it copies 10 units each tim the button is selected.  However, I don't think this is a good long term solution. 

  • 01-02-2012 09:51 AM In reply to

    Re: Save multiple documents

    What I'm wondering is if it would be possible to add another field to your repeating group - called "Save" or something, set to False by default. The rule that would save the unit as a form could be set on that field - when True, the rules execute. The button then, sets that field to True - since the button is outside of the repeating group, this would set every instance of Save to true - then each instance would execute its own rule to save with. I think this would work around the maximum actions issue.

    Hilary Stoupa

  • 02-06-2012 05:04 AM In reply to

    I have tried to think thru your suggestion and am not getting it.  I created a sample form which I have uploaded.  Can you demo this using this form?

     

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