locked
Calculate with dates in a infopath formula RRS feed

  • Question

  • Hello,
    how to i get this functionality in a infopath?

    If todays day > 15
        1. day in next month + 1 month
    else
        1. day in next month
    Jakob Olsen
    Friday, March 25, 2011 9:49 AM

Answers

  • I "solved" it with custom code so fare:

     

    public void FormEvents_Loading(object sender, LoadingEventArgs e)
            {
                DateTime orderDate = new DateTime(DateTime.Now.Year, DateTime.Now.Month, 1);
                int LastDay = 15;
                if (DateTime.Now.Day > LastDay)
                {
                    orderDate = orderDate.AddMonths(2);
                }
                else
                {
                    orderDate = orderDate.AddMonths(1);
                }
                setInfoPathValue("/my:mineFelter/my:grpBrugerInfo/my:dateDato", orderDate.ToShortDateString());
            }


    Jakob Olsen
    Friday, March 25, 2011 11:03 AM