Submitting using field values - InfoPath Dev
in

InfoPath Dev

Submitting using field values

Last post 04-04-2006 11:25 AM by CycleFitness. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 04-03-2006 01:14 PM

    Submitting using field values

    Hello:

    I have a status report with a Submit data connection that uses this formula:

    concat(concat(Date, "_", txtEmpl)

    That is, the date of the status report followed by the employee's name. The problem is that I want to allow overwrite so they can modify a previous report, but I don't want their previous report to be overwritten if they use it as the basis for the next status report. I need a confirm dialog "Are you sure you want to overwrite the form dated x". I tried adding a formula that checks the date in the form and if it's older than today change the date to today, but that doesn't account for a user creating their status report for last week this week.

    Any ideas?

    Thanks!
  • 04-03-2006 02:28 PM In reply to

    Re: Submitting using field values

    Was this thread not useful?
    http://infopathdev.com/forums/topic.asp?TOPIC_ID=2030

    With this if the user clicks "OK" then you will just overwrite the form, if they click "Cancel", you could generate a new filename and save it as the new filename.

    Take a look at the XDocument.UI.SetSaveAsDialogFileName and XDocument.UI.SetSaveAsDialogLocation methods.

    Hope this helps!
    Matt Faus / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
  • 04-04-2006 08:23 AM In reply to

    Re: Submitting using field values

    Yeap, that thread was useful for getting the message box, but I'm missing all the checking conditions; i.e., if the filename of the record in the Sharepoint list already exists.

    Does submit use the "Save" methods? I thought those were restricted to save operations.

    On thinking through the requirements further, here's what I would like to happen:

    1) On Submit, if the date is the same as it was when the form was first filled out, then present a "Do you want to overwrite?" message box. If they say no, the user needs to change the date.

    How do I establish whether that date has changed? The IsDirty property seems to apply to the XDocument object, not a specific field within the document.

    Thanks!
  • 04-04-2006 11:17 AM In reply to

    Re: Submitting using field values

    So, here's what I'm trying:

    1) I added a text field for "OrigDate". I've hidden it by making the font color and borders white.
    2) I added a Rule that sets OrigDate to FormDate if OrigDate is blank. That should happen the first time the form is used.
    3) My submit action runs a rule that checks if OrigDate=FormDate. If it does, it switches to a view where an option button is displayed. Option 1 is Overwrite original. Option 2 displays the value of FormDate and lets the user change it. There is also a Submit button on this view that does the same thing as the other view's Submit button.

    So far so good, except for one minor glitch. During the Submit process two rules are run in this order:

    1. Check Date (OrigDate=FormDate) (If true, switch Views)
    2. Submit.

    The problem is if Rule 1 is true, the views aren't switched, the form just closes. If I try and check the "Stop processing after this rule finishes," the form also closes.

    BTW, there is also code that closes InfoPath at the end. I assume code is always processed after Rules.

    How do I get Rule 1 to switch views and stop? It's almost like the stop function interferes with the View being shown.
  • 04-04-2006 11:25 AM In reply to

    Re: Submitting using field values

    One other thing ... When I have the "Stop processing when this Rule finished" unchecked, the View switches but the error appears "Some rules did not finish processing" and then the app closes. I assume that's because it's continuing to try and process the second rule, which is Submit.
Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.