Populating fields with data from a secondary data sorce

S

sebastian.bettels

Hi,
I'm fearly new to InfoPath and have following problem:
I'm to create a form that shows employs projects and how much time
they spend on it(startTime, endTime) now I need a field that shows the
duation of the project (endTime-startTime) now since I have no clue
about jscript I created a secondary data source baste on an SQL-Query
which only has projectedID ,startTime, endTime and a field Duration
which is calculated based on the SQL-Server Tablel which I use in my
primary data sorce. Now I have the information I need(duration) but my
problem now is to schow this in a repeating table I either get no
information or all durations on every project(more than 6000 entrys)
but I only want to see the duration on the projects that the query on
the primary date sorce returned(i.e.
projectIDprimary=projectIDsecondary) but still I get all 6000 entrys.
Now I hope you can help me solve my problem.
Oh, all the projects that were returnd by the quere are shown in a
repeating table incase that is importand.
I'm very thankful for any help
 
F

Franck Dauché

Hi Sebastian,

You need to filter results from your secondary data source based on your
projectID. You could do this by code.
Try to start from:

ADOAdapterObject adapter =(ADOAdapterObject)
thisXDocument.DataAdapters["ConnectionName"];
adapter.Command = string.Format("Select * from tblTest where
projectIDsecondary='23'");
adapter.Query();

Hope that it helps,

Regards,

Franck Dauché
 
R

Ross B

Franck - for a non-programmer, where would this code go?

Or, does using Infopath require programming skills for anything beyond
relatively simple forms & data connections?


Franck Dauché said:
Hi Sebastian,

You need to filter results from your secondary data source based on your
projectID. You could do this by code.
Try to start from:

ADOAdapterObject adapter =(ADOAdapterObject)
thisXDocument.DataAdapters["ConnectionName"];
adapter.Command = string.Format("Select * from tblTest where
projectIDsecondary='23'");
adapter.Query();

Hope that it helps,

Regards,

Franck Dauché


Hi,
I'm fearly new to InfoPath and have following problem:
I'm to create a form that shows employs projects and how much time
they spend on it(startTime, endTime) now I need a field that shows the
duation of the project (endTime-startTime) now since I have no clue
about jscript I created a secondary data source baste on an SQL-Query
which only has projectedID ,startTime, endTime and a field Duration
which is calculated based on the SQL-Server Tablel which I use in my
primary data sorce. Now I have the information I need(duration) but my
problem now is to schow this in a repeating table I either get no
information or all durations on every project(more than 6000 entrys)
but I only want to see the duration on the projects that the query on
the primary date sorce returned(i.e.
projectIDprimary=projectIDsecondary) but still I get all 6000 entrys.
Now I hope you can help me solve my problem.
Oh, all the projects that were returnd by the quere are shown in a
repeating table incase that is importand.
I'm very thankful for any help
 
B

Bojana Marjanovic [MSFT]

You can put a default value on the field showing the duration that points to
the duration field in your secondary data source. When you do this, you want
to click on Filter Data in the dialog that allows you to choose the field
you want to act as your default value and then say that you only want one
where the projectIDprimary = projectIDsecondary.

Hope this helps,
Bojana

Ross B said:
Franck - for a non-programmer, where would this code go?

Or, does using Infopath require programming skills for anything beyond
relatively simple forms & data connections?


Franck Dauché said:
Hi Sebastian,

You need to filter results from your secondary data source based on your
projectID. You could do this by code.
Try to start from:

ADOAdapterObject adapter =(ADOAdapterObject)
thisXDocument.DataAdapters["ConnectionName"];
adapter.Command = string.Format("Select * from tblTest where
projectIDsecondary='23'");
adapter.Query();

Hope that it helps,

Regards,

Franck Dauché


Hi,
I'm fearly new to InfoPath and have following problem:
I'm to create a form that shows employs projects and how much time
they spend on it(startTime, endTime) now I need a field that shows the
duation of the project (endTime-startTime) now since I have no clue
about jscript I created a secondary data source baste on an SQL-Query
which only has projectedID ,startTime, endTime and a field Duration
which is calculated based on the SQL-Server Tablel which I use in my
primary data sorce. Now I have the information I need(duration) but my
problem now is to schow this in a repeating table I either get no
information or all durations on every project(more than 6000 entrys)
but I only want to see the duration on the projects that the query on
the primary date sorce returned(i.e.
projectIDprimary=projectIDsecondary) but still I get all 6000 entrys.
Now I hope you can help me solve my problem.
Oh, all the projects that were returnd by the quere are shown in a
repeating table incase that is importand.
I'm very thankful for any help
 

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