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 2006

Tip: Looking for answers? Try searching our database.

Get correct value

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Lu Prodesso - 26 Feb 2006 16:25 GMT
Hi all.
I have a infopath with a repeating group(1) with 2 fields(A and B), and I
have an other repeating group in which I must be able to select(drop
down-field C) out of repeating group (1-field A ) which I can manage. Now I
want value in field- D to automaticly fill with the value of the
corresponding value in field B in repaeting group 1. I want to do this in the
OnAfterChange of field C in C#-code.

Does anyone know any examples or ideas ?
Signature

Lu

Adam Harding - 27 Feb 2006 10:17 GMT
Lu

I dont think you need to use code to achieve this as you can do when field
is not blank rule to achieve stuff.

Am i understanding you correctly:

You have a repeating section with

Field A and Field B on dropdown lists

You have another Field C which is user definable and you want to use the
relation betwen A and B to define Field D automatically

You have to change the default value of FieldD to equal a secondary data
source field, then click filter and add filters to your hearts content setup
something like where FieldC relates to FieldB or something similar.

I hope this helps

Cheers Adam

> Hi all.
> I have a infopath with a repeating group(1) with 2 fields(A and B), and I
[quoted text clipped - 5 lines]
>
> Does anyone know any examples or ideas ?
S.Y.M. Wong-A-Ton - 27 Feb 2006 10:32 GMT
Like Adam said, you can do this without code, so you may want to consider this.

You never really specified where field D was located. Is it in the same
group as field C? Is field A unique in its group? This way it would be easier
to retrieve field B using a filter on repeating group 1.
---
S.Y.M. Wong-A-Ton

> Hi all.
> I have a infopath with a repeating group(1) with 2 fields(A and B), and I
[quoted text clipped - 5 lines]
>
> Does anyone know any examples or ideas ?
Lu Prodesso - 27 Feb 2006 13:20 GMT
Yes D it is in the same group as C and field A is unique.
Many thanks...

Signature

Lu

> Like Adam said, you can do this without code, so you may want to consider this.
>
[quoted text clipped - 13 lines]
> >
> > Does anyone know any examples or ideas ?
S.Y.M. Wong-A-Ton - 27 Feb 2006 16:41 GMT
I don't have code at hand for this, but it shouldn't be difficult to
implement. Here is what you can do...

Look into the Source object on the event object (eventObj.Source) that is
being passed to the OnAfterChange event handler for field C. This will enable
you to get to the value of field C (which should be equal to field A) as well
as field C itself. Then you need to retrieve the parent of field C and use a
selectSingleNode on the parent to get to field D, which has the same parent
as field C. You can then use a filter in an XPath expression on group 1 to
get to field A. Once you have field A, navigate to its parent, and then use a
selectSingleNode on the parent to get to field B and its value. Note: It
should also be possible to use 1 XPath expression to get immediately to field
B and its value. Set the value of field D to the value of field B and you're
done.  
---
S.Y.M. Wong-A-Ton

> Yes D it is in the same group as C and field A is unique.
> Many thanks...
[quoted text clipped - 16 lines]
> > >
> > > Does anyone know any examples or ideas ?
S.Y.M. Wong-A-Ton - 04 Mar 2006 15:28 GMT
For those of you who need a visual sample on how this is done, I've posted a
"recipe" (=solution) on how to programmatically retrieve the value of another
field in the same row of a repeating table using JScript, here:
http://enterprise-solutions.swits.net/infopath/retrieve-field-value-same-row-rep
eating-table.htm


You can easily convert the code to C# by replacing "XDocument" with
"thisXDocument", "var" with "string", and "eventObj" with "e".
---
S.Y.M. Wong-A-Ton

> I don't have code at hand for this, but it shouldn't be difficult to
> implement. Here is what you can do...
[quoted text clipped - 33 lines]
> > > >
> > > > Does anyone know any examples or ideas ?
 
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.