Drop Down List and SharePoint Problem

C

Chrisf

I have 2 cascading drop down lists which call a web service to get their
values. The 1st one returns the division_id (value), and division_desc
(display). The 2nd one returns the program_id (value), and program_desc
(display) for programs in the selected division. When I create a form both
drop down lists show the correct descriptions. The form is submitted to a
SharePoint document library but when I open it there the 2nd drop down list
shows program_id and not program_desc, while the 1st drop down list correctly
has the division_desc.

Does anyone have any idea what the problem could be? I am using InfoPath
2007 and SharePoint 2007.
 
P

Paresh

I have 2 cascading drop down lists which call a web service to get their
values. The 1st one returns the division_id (value), and division_desc
(display). The 2nd one returns the program_id (value), and program_desc
(display) for programs in the selected division. When I create a form both
drop down lists show the correct descriptions. The form is submitted to a
SharePoint document library but when I open it there the 2nd drop down list
shows program_id and not program_desc, while the 1st drop down list correctly
has the division_desc.

Does anyone have any idea what the problem could be? I am using InfoPath
2007 and SharePoint 2007.

Hi,

I think, the second data connection is not getting fired properly.
Take a look at the following reference link. I think, this will be
helpful to you
http://blogs.msdn.com/infopath/archive/2006/10/12/cascading-dropdowns-in-browser-forms.aspx

Do let me know in case you need any further information.

Thanks,
Paresh
http://www.openzeas.com/blogs/Paresh
 
C

Chrisf

Thank you very much for the very helpful link. The example given is dealing
only with IDs where the ID is used both for the value and display for the
drop down list. I need to have the division_id in order to find all of the
programs for that division, but I want to display the description in the drop
down list. Both web services return the id and description.

Entries:
/dfs:myFields/dfs:dataFields/tns:GetDivResponse/tns:GetDivResult/NewDataSet/Divisions
Value: DIVISIONS_ID
Display Name: DIV_DESC


Entries:
/dfs:myFields/dfs:dataFields/tns:GetProgResponse/tns:GetProgResult/NewDataSet/Programs
Value: PROGRAM_ID
Display Name: PROGRAM_DESC

Is there any additional step that I am overlooking?

The strange thing is that when I create a new form and select the Division
from the 1st drop down list, all of the Programs in that Division are listed
as expected but after selecting the Program, submitting it, and then
returning to edit it, the 2nd drop down list displays the program_id and not
the description.
 
S

Santhosh (GGK Tech)

Hi,

You may not have checked 'Automatically retrive data when form is opened'
check box in Data connection wizard while taking second data connection.
 
C

Chrisf

Checking the 'Automatically retrieve data when form is opened' didn't solve
the problem because I need to wait until the Division is selected in the 1st
drop down list.

The web service returns both an id and a description. How can I go about
saving both in the form? I would like it to save the description as the value
for the drop down list and also save the id as I need to use the id for
several list boxes that gets it's value from a web service?
 
S

Santhosh (GGK Tech)

Hi,

Use the code which you are using for Onafter change event of 1st drop down
in form onload event.

And for saving the display name in form add an attribute to drop down field
and in default value use the formula to filter the values from webservice.
Put the filter condition on id field.
 
C

Chrisf

Hi Santhosh,

I'm a InfoPath newbie so I'm not real familiar with all of the terms. Could
you possibly give me a little more detail for the 2nd part of your reply? The
drop down list is called Programs. Do you mean I should right click on
Programs in the Data Source panel and add a field such as ProgID? The web
service returns program_id and program_desc. What should the formular look
like?

Thank you very much for your help.
 
S

Santhosh (GGK Tech)

Hi,

You should have two fields in main schema like ProgID, ProgDesc.
First bind the 'ProgID' field to 2nd drop down control so that ID will we
stored here. And to set the value for 'ProgDesc' follow these steps


1. Go to properties of the 'ProgDesc' field.

2. Click on "fx" icon in Default value.

3. Click on "Insert Field or Group" button in Insert Formula window.

4. Select 'program_desc' in secondary data source and click on ‘Filter Data'
button.

5. Click on ‘Add' button in Filter Data window.

6. Select 'program_id' field in left side dropdown and in second drop down
select ‘equal to'.

7. In third drop down select 'ProgID' from main data source.
 
C

Chrisf

That was a great help! Thank you very much!

Santhosh (GGK Tech) said:
Hi,

You should have two fields in main schema like ProgID, ProgDesc.
First bind the 'ProgID' field to 2nd drop down control so that ID will we
stored here. And to set the value for 'ProgDesc' follow these steps


1. Go to properties of the 'ProgDesc' field.

2. Click on "fx" icon in Default value.

3. Click on "Insert Field or Group" button in Insert Formula window.

4. Select 'program_desc' in secondary data source and click on ‘Filter Data'
button.

5. Click on ‘Add' button in Filter Data window.

6. Select 'program_id' field in left side dropdown and in second drop down
select ‘equal to'.

7. In third drop down select 'ProgID' from main data source.
 

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