Dynamic Year Generation - InfoPath Dev
in

InfoPath Dev

Dynamic Year Generation

Last post 03-28-2012 09:40 PM by Jo-Anne Alfafara. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 03-28-2012 08:44 PM

    Dynamic Year Generation

    Im not sure whether its possible without custom coding or not. Really looking for the help...Been couple of days, looking on this problem but still not able to figure out how to achieve it.Im using Sharepoint 2010, default form. Here's the requirement:

    Need to generate value (in this case Year) in dropdown box based on Current Year.

    For example: if the current date falls between,

    1st May, 2012 - 30th Sept, 2012, the values on dropdown box should be 2012 and 2013

    1st Oct, 2012 - 30th April, 2013, the value on dropdown box should be only 2013

    1st May, 2013 - 30th Sept, 2013, the values on dropdown box should be 2013 and 2014

    1st Oct, 2013- 30th April, 2014, the value on dropdown box should be only 2014

    and similarly goes on....

    Any help will be really appreciated.... Hoping for some kind of ideas or help...

    Thanks in advance....

  • 03-28-2012 09:40 PM In reply to

    Re: Dynamic Year Generation

    Hello and welcome to InfoPathdev!

    I think you can use substring function to check if data is equal to May-Sept or Oct-April. You can download a free sample of date formulas here.

    Based on your substring condition, you can do substring again to get the year for May and calculate September's year + 1. For Oct-April, just substring the year for April.

    The next challenge is - how do you put those values in the dropdown box? Anyway, I hope this idea will help you get started..

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.