Versioning and Current Date - InfoPath Dev
in

InfoPath Dev

Versioning and Current Date

Last post 08-01-2012 07:44 AM by BejeweledOne. 8 replies.
Page 1 of 1 (9 items)
Sort Posts: Previous Next
  • 07-31-2012 07:01 AM

    Versioning and Current Date

    I want to be able to display the current version of the form on the form itself (have this piece in place) and have it update a date box when the version changes. I have tried doing this a couple of ways but the date box always displays today's date regardless if the version has changed or not. In both scenarios Versioning is set to 'Automatically Update'. Not sure this setting would affect what I want to do. The first way was to do a 'set field' action from the version field - Condition: Run when field changes - set date in date field to 'today()'. Second way Hidden date field set to 'today()'. Version field - condition: run when field changes - set date in version date field to = hidden date field. The only conclusion I can draw from this is the version must be read and 'updated' each time the form is opened. I really need this to be in the form and not a promoted field in the SharePoint library. Any help will be greatly appreciated.
  • 07-31-2012 10:17 AM In reply to

    Re: Versioning and Current Date

    You can display the form's version number from the processing instructions by adding an expression box (calculated value) by using this formula:

    substring-before(substring-after(/processing-instruction()[local-name(.) = "mso-infoPathSolution"], 'solutionVersion="'), '"')

    Hope this helps!

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


  • 07-31-2012 10:23 AM In reply to

    Re: Versioning and Current Date

    Sorry if I didn't make myself clear. I have that part down fine. I want to be able to trigger a date field change when the version number changes. I thought I would be able to do that by a simple 'set field value' making the rule to set the date to 'today()' when the version updated. Unfortunately it changes the date everyday. This tells me that the version field must be checked and updated every time you open the form. If you can tell me how to set a date field to the current date (the same date that the version number updates) when the version changes that would be great.
  • 08-01-2012 06:12 AM In reply to

    I'm just guessing... You can set the value of a field to use the version number formula above, then have a rule that sets a date field.

    I don't know whether this is exactly what you want, but I'm attaching a sample form that you can look at in design mode.

    Good luck!

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


  • 08-01-2012 06:49 AM In reply to

    Re: Versioning and Current Date

    I did this already. I used the set field value to set the date field to 'today()' when the version field changed. Every day it sets the date to the current date even if the version didn't change. This makes me think that when the form is opened it must read the version and 'update' the version field. Pretty sure I indicated in my initial post and the reply that I had already tried this.
  • 08-01-2012 06:59 AM In reply to

    Re: Versioning and Current Date

    That's a good point.

    What about storing the version in the main DOM (my:CurrentVersion) and ALSO read in the version from the processing instructions on Form Load (my:FormLoadVersion) and then, if they don't match, run the rule to set the date?

    Just an idea - not sure if it will work though! Good luck!

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


  • 08-01-2012 07:14 AM In reply to

    Re: Versioning and Current Date

    Can you give me an example of how to set that up? Thanks
  • 08-01-2012 07:26 AM In reply to

     Sure, here's an attempt. Hope it helps.

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


  • 08-01-2012 07:44 AM In reply to

    Re: Versioning and Current Date

    Sorry to seem obtuse, but when you refer to (my:currentversion) and (my:formloadversion) I am not exactly sure what you mean. I suspect that the 'my:formloadversion' is the version that is retrieved with the substring formula you provided above, but I want to be positive. I am still fairly new to InfoPath and while I am fairly good at setting up rules and such and figuring out the logic behind them, I am not quite up to snuff on all the terms for xpath and such.
Page 1 of 1 (9 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.