debugging a complicated form & daylight savings calculuations - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

debugging a complicated form & daylight savings calculuations

Last post 08-29-2011 12:54 PM by pyrocam. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 05-08-2011 02:54 PM

    debugging a complicated form & daylight savings calculuations

    Hi guys, I have a rather complicated web based change control form, that allows you to pick a region, and the form will automatically put that regions current timezone in.

     

     

    change control form

    In the above image, there is a dropdown box (populated by a list in sharepoint) that allows you to pick a region, when the region changes, it looks at another list (below) that stores the daylight savings dates for the next 5 years

     example of daylight savings times

     

    Then, I populate some hidden textboxes with these dates, and workout if today falls between them, if so it checks the checkbox next to it (in this example, I am using UK as the region, so you can see that we are in DST

     

    timezone worker

    the  rules work like so:

     rules

     First five rules will set the checkbox if today is between the two dates

    the 6th and 7th rules 'sum' the checkboxes, IE, if any of the checkboxes are checked, then a 'total' checkbox called 'IN_DST' is checked, if none are checked its not checked

    8 and 9 will do a lookup on the list again, if in DST is true then set the timezone to whatever the list says the timezone should be if in DST, OR if IN_DST is false, then do the opposite.

     

    This is the Logic Inspector of the above explanation:

     

     

     

    OK, so my first question is, is there a better way to do this? this feels like the most backwards way to figure out the current timezone of a region

    My second question, if this is the only way to do this with what I have available; how can I debug this further? at the moment there is a problem whereby if I set the region to a non-existing selection from the drop down (eg blank or a <-- please pick your region --> option )  then pick a real region, it will set the IN_DST checkbox to true regardless of any of the other checkboxes being checked, what I am having trouble with is diagnosing where the problem lies, I want a console or something I can step-through the form while it runs.

     

    Thanks in advance

     

     

     

  • 05-16-2011 10:19 AM In reply to

    Re: debugging a complicated form & daylight savings calculuations

    Hi:

    Is there any chance an existing web service could suit your needs? Here's a StackOverflow question that mentions some that may be worth trying.... I wouldn't want to have to maintain this kind of thing myself when there are other options....

    Hilary Stoupa

  • 05-16-2011 01:20 PM In reply to

    Re: debugging a complicated form & daylight savings calculuations

     Hi Hillary, thanks for your response.

    Yes I think one of those would suit nicely for anyone else trying to do this, I wish I had seen that before starting this feature :)

     

    I have ended up using a workaround (creating an entry in the db called <--- choose region ---> ) since I already have spent too many hours getting this working, trying to start over with a new data source may be too timeconsuming for this project.

     

     

     

     

  • 08-29-2011 10:29 AM In reply to

    • nithra
    • Not Ranked
    • Joined on 03-09-2011
    • Posts 3

    Re: debugging a complicated form & daylight savings calculuations

    Hi,

    I am working in Sharepoint application which is using Infopath forms.I have few date fields in Infopath form.Since the server located in U.S and this application was accessed by users who are in different work location in world , when comparing date it fails.
    Example:-
    If a user is in Austrailia and they are attempting to put in "today's" date (8/19/2011) which according to the server in U.S is greater than the system(Server) date in U.S (8/18/2011), the date validation is failing.
    We are currently using data validation formula today() in date field which is getting server machine time.To get the client machine time ,I used Javascipt code in formserver.aspx where able to get the client machine time but not able to bring into Infopath form.Please give some inputs.

  • 08-29-2011 12:54 PM In reply to

    Re: debugging a complicated form & daylight savings calculuations

     if its an internal only form, and the location information is published in your AD, you could use the sharepoint AD lookup to get the users region. then change your code to suit per region. doing your own verification if you have to.

    if you have many different locations that might be alot of work though.

     

    OR, drop that verification out completely,

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