Solved

XPath / Rules  in InfoPath 2010

Posted on 2011-03-14
5
1,104 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction It seems that at least a couple of times per month, I answer a question that requires automating Outlook from another Microsoft Office application, usually (although not always) to send one or more email messages.  For example: …
This article will guide you to convert a grid from a picture into Excel format using Microsoft OneNote and no other 3rd party application.
The viewer will learn how to use a discrete random variable to simulate the return on an investment over a period of years, create a Monte Carlo simulation using the discrete random variable, and create a graph to represent the possible returns over…
Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

911 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

24 Experts available now in Live!

Get 1:1 Help Now