Infopath and using the current function in a repeating field problem

P

Patrick

All,
I need some help. I am having a hard time unstanding the usage of the
current function. Basically I am altering the Purchase order template
from Microsoft to suit my needs. The problem I am coming across is how
to correctly use the current function. If you check out the infopath
Purchase order template you will see a repeating section with the field
part number in the repeating section. Basically I want the field
description to auto fill in the part number. I can get it to populate
but obviously only the first table of the repeating field is filled out
properly, and that value is carried over to every other additional
inserted table. So my quesiton is how do I use the current function?
My the value from my sql database that the decription in bound to is
called Part_name. The rule is as seen below with the destination field
on the form as partNumber. I kept it the same as the template.
@Part_Number[@Part_Name = description]

The XPATH looks like this
xdXDocument:GetDOM("Van
Layout")/dfs:myFields/dfs:dataFields/dfs:van_layout/@Part_Number[../@Part_Name
=
xdXDocument:get-DOM()/po:purchaseOrder/po:eek:rder/po:items/po:item/po:description]

Where and how do I use the current function. I have searched and
seached and none of the examples or posts I have found make much sense.
Any instructors out there?
 
R

Raghuram

Hi Patrick, I think u can accomplish this task without using current function
also, just follow the below given steps

1. Double-click on the part number field
2. In the default-value section of “Text-Box Properties†click the “fx†button
3. In the “insert formula†dialog box click “Insert a Field or Group†and
select “Description†and click “Ok†3 times to close all the open dialog boxes
4. Now pre-view the form

Hope this will help you
 
P

Patrick

I tried that and it did not work. I think that it didn't work because
both fields are apart of the same repeating table. Can you tell me how
to use the current function?
Raghuram said:
Hi Patrick, I think u can accomplish this task without using current function
also, just follow the below given steps

1. Double-click on the part number field
2. In the default-value section of "Text-Box Properties" click the "fx" button
3. In the "insert formula" dialog box click "Insert a Field or Group" and
select "Description" and click "Ok" 3 times to close all the open dialog boxes
4. Now pre-view the form

Hope this will help you

--
Raghuram
http://www.autonomysystems.com


Patrick said:
All,
I need some help. I am having a hard time unstanding the usage of the
current function. Basically I am altering the Purchase order template
from Microsoft to suit my needs. The problem I am coming across is how
to correctly use the current function. If you check out the infopath
Purchase order template you will see a repeating section with the field
part number in the repeating section. Basically I want the field
description to auto fill in the part number. I can get it to populate
but obviously only the first table of the repeating field is filled out
properly, and that value is carried over to every other additional
inserted table. So my quesiton is how do I use the current function?
My the value from my sql database that the decription in bound to is
called Part_name. The rule is as seen below with the destination field
on the form as partNumber. I kept it the same as the template.
@Part_Number[@Part_Name = description]

The XPATH looks like this
xdXDocument:GetDOM("Van
Layout")/dfs:myFields/dfs:dataFields/dfs:van_layout/@Part_Number[../@Part_Name
=
xdXDocument:get-DOM()/po:purchaseOrder/po:eek:rder/po:items/po:item/po:description]

Where and how do I use the current function. I have searched and
seached and none of the examples or posts I have found make much sense.
Any instructors out there?
 
A

Adam Harding

Patrick

Try the current function in a variety of places AFTER the equals sign like
this

xdXDocument:GetDOM("Van
Layout")/dfs:myFields/dfs:dataFields/dfs:van_layout/@Part_Number[../@Part_Name
= current()/po:description

if that does not work try it at the higher level as below

xdXDocument:GetDOM("Van
Layout")/dfs:myFields/dfs:dataFields/dfs:van_layout/@Part_Number[../@Part_Name
=Current()/po:purchaseOrder/po:eek:rder/po:items/po:item/po:description

If that does not work try it the next step down.

=Current()/po:items/po:item/po:description and so on.

Cheers Adam



Patrick said:
I tried that and it did not work. I think that it didn't work because
both fields are apart of the same repeating table. Can you tell me how
to use the current function?
Raghuram said:
Hi Patrick, I think u can accomplish this task without using current function
also, just follow the below given steps

1. Double-click on the part number field
2. In the default-value section of "Text-Box Properties" click the "fx" button
3. In the "insert formula" dialog box click "Insert a Field or Group" and
select "Description" and click "Ok" 3 times to close all the open dialog boxes
4. Now pre-view the form

Hope this will help you

--
Raghuram
http://www.autonomysystems.com


Patrick said:
All,
I need some help. I am having a hard time unstanding the usage of the
current function. Basically I am altering the Purchase order template
from Microsoft to suit my needs. The problem I am coming across is how
to correctly use the current function. If you check out the infopath
Purchase order template you will see a repeating section with the field
part number in the repeating section. Basically I want the field
description to auto fill in the part number. I can get it to populate
but obviously only the first table of the repeating field is filled out
properly, and that value is carried over to every other additional
inserted table. So my quesiton is how do I use the current function?
My the value from my sql database that the decription in bound to is
called Part_name. The rule is as seen below with the destination field
on the form as partNumber. I kept it the same as the template.
@Part_Number[@Part_Name = description]

The XPATH looks like this
xdXDocument:GetDOM("Van
Layout")/dfs:myFields/dfs:dataFields/dfs:van_layout/@Part_Number[../@Part_Name
=
xdXDocument:get-DOM()/po:purchaseOrder/po:eek:rder/po:items/po:item/po:description]

Where and how do I use the current function. I have searched and
seached and none of the examples or posts I have found make much sense.
Any instructors out there?
 
P

Patrick

Thanks man. That really helped a lot!!!! One thing different that I had
to do was add current()/../ instead of current()/ And I read that
in another post where somesaid if it doesn't work one way try it the
other way, but it didn't make sense to me because I was so confused
about the current function, but you really helped me with it. Thanks
again.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top