none
Infopath setting due date to 15 business days

คำตอบ

  • Hi SPDEV2010,

    As you have probably seen, there is the "addDays" function in InfoPath that will allow you to add a specific number of days to a date value but this does not exclude weekends and holidays. You can use some custom XPATH expressions to not count weekends; however, unless you hard-code all holidays into a resource file in InfoPath there is no "dynamic" way to account for holidays. With this method, you would need to update that XML file, say, each year so you have all the current holiday dates. Someone has already created a sample like this - here is a link to where you can find the sample form:

    http://alecpojidaev.wordpress.com/2008/12/30/infopath-codeless-programming-walkthrough-2/

    Now, if you want this process to be dynamic then you will need to use code to calculate a future date that takes into consideration weekends and holidays.

    Scott


    Scott Heim - Microsoft Office InfoPath and SharePoint Designer Online Community Support

    • ทำเครื่องหมายเป็นคำตอบโดย Scott He - MSFT 21 มิถุนายน 2555 13:38
    21 มิถุนายน 2555 13:38
  • Hi SPDEV2010,

    We are seeing different results: I put in a begin date of 6/1/2012 and an end date of 6/22/2012 and it correctly returns 16 work days:

    If I change the start date to 6/4/2012, it correctly reflects 15 working days:

    

    Again, this is using the "WorkDaysCalc.xsn" sample from the site I referenced. So unless I am misunderstanding what you need, this sample provides the solution you asked for...other than holidays.

    Scott


    Scott Heim - Microsoft Office InfoPath and SharePoint Designer Online Community Support

    • ทำเครื่องหมายเป็นคำตอบโดย Scott He - MSFT 27 มิถุนายน 2555 12:36
    27 มิถุนายน 2555 12:36

ตอบทั้งหมด