Solved

XPath / Rules  in InfoPath 2010

Posted on 2011-03-14
5
1,101 Views
Last Modified: 2012-05-11
Hello Guys,

i got a little problem with InfoPath 2011, i want to check the day of the week with the function xdDate:Today().

Unfortunatly rules i append, to check if the day either starts with monday or tuesday ALWAYS fail. I really don't have a clou why this happens, cause it seems pretty clear on first sight, but it wont work for me?

Any Ideas on this behavior?
0
Comment
Question by:pa_gmbh
  • 3
  • 2
5 Comments
 
LVL 9

Expert Comment

by:McOz
ID: 35130406
The reason checking for "Monday" or "Tuesday" always fails is because Today() does not return the name of the day, it returns a date in the format "2011-03-14".

There is no easy way to get the day name, but you can do it with code. See this link for an example of how this is done:

http://groups.google.com/group/microsoft.public.infopath/browse_thread/thread/94cab487feadc280/bf23d09bd5fbe274?lnk=raot&pli=1

Good luck!
0
 
LVL 9

Expert Comment

by:McOz
ID: 35150912
pa_gmbh, I did a little more looking around for a date-to-day formula in infopath. Here's a way to get it *without* code:

http://blueinfopath.wordpress.com/2009/11/22/weekday-name-function-in-infopath/

Hope it helps!
0
 

Author Comment

by:pa_gmbh
ID: 35199057
I did it with the attached file.

Works very well!
0
 

Accepted Solution

by:
pa_gmbh earned 0 total points
ID: 35199074
0
 

Author Closing Comment

by:pa_gmbh
ID: 35230047
this is a testtemplate to test the form.

It`s works perfectly!
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

PaperPort has a feature called the "Send To Bar". It provides a convenient, drag-and-drop interface for using other installed software, such as Microsoft Office. However, this article shows that the latest Office 2016 apps (installed with an Office …
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
The viewer will learn how to simulate a series of coin tosses with the rand() function and learn how to make these “tosses” depend on a predetermined probability. Flipping Coins in Excel: Enter =RAND() into cell A2: Recalculate the random variable…
The viewer will learn how to use the =DISCRINV command to create a discrete random variable, use this command to model a set of probabilities and outcomes in a Monte Carlo simulation, and learn how to find the standard deviation of a set of probabil…

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now