Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / March 2008

Tip: Looking for answers? Try searching our database.

Rules

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ed Thurber - 29 Feb 2008 16:32 GMT
Hello all:

hope someone can help me with this.  I have an element that has a default
value of

count(../../../my:Header[msxsl:string-compare(my:Curr_Prj_Dts/my:POC,
my:Prom_Prj_dts/my:POC) > 0 and my:Prty <= 10 and my:Dev_Grp =
current()/../../my:Dev_Grp])

which sets the element to a count of items in a repeating group that meet a
certain criteria.  This works fine.

There are also rules set up on this this element that state if the count = 0
then set the value in another element to somthing, and if the count > 0 to
set the value in the other element to something else.  This also works.

I want to get rid of the first element and use rules on the second element
to set the value directly.  I thought I could just paste the above equasion,
with the proper logical operator at the end, into the condition as an
expression and it would work.

count(../../../my:Header[msxsl:string-compare(my:Curr_Prj_Dts/my:POC,
my:Prom_Prj_dts/my:POC) > 0 and my:Prty <= 10 and my:Dev_Grp =
current()/../../my:Dev_Grp]) = 0

or

count(../../../my:Header[msxsl:string-compare(my:Curr_Prj_Dts/my:POC,
my:Prom_Prj_dts/my:POC) > 0 and my:Prty <= 10 and my:Dev_Grp =
current()/../../my:Dev_Grp]) > 0

It does not.

No errors thrown, just does not set the value.

Any trick to using expressions?

Ed
Clay Fox - 29 Feb 2008 21:48 GMT
You might need to rebuild your expression rather than pasting.
Another possibility is the context has changed. If you are using this now
within a repeating section then it will not see all rows of the data.

Often you need to do counts as you had it originially, in your form data, so
that it can see across all records. Otherwise you need to bind to the
repeating group rather than a particular field so that you can get across all
records.
Signature

Clay Fox / Microsoft InfoPath MVP
www.InfoPathDev.com / The InfoPath Authority / Downloads, Samples, How-To,
Experts, Forum

> Hello all:
>
[quoted text clipped - 34 lines]
>
> Ed
Ed Thurber - 03 Mar 2008 16:13 GMT
Clay:

Thanks for the reply.  An interesting solution that I had not thought of.
Please let me rephrase and let me know if I am understanding you.

Instead of placing the rules on the second element, place them on the group
that I am counting (my:Header)?

Ed

> You might need to rebuild your expression rather than pasting.
> Another possibility is the context has changed. If you are using this now
[quoted text clipped - 50 lines]
>>
>> Ed
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.