Binding Controls to Database rows

K

K'ur

Hi,

I am new to this newsgroup and infopath too. A quick response will be highly
regarded. My question is pretty simple but i guess since I am new to this, it
seems confusing to me.

Question: We are planning to use infopath forms within an already
implemented organization wide CRM software. Now the question is when a user
calls an infopath form from this CRM software, I want it to be loaded with
certain data field values coming from the database. What I find difficult is,
without using the QUERYFIELD, how do we get this data fields populated during
the form onLoad() event. Will I have to code it or can I just bind the data
fields (for e.g. textbox) to its value in the database so that when we load
the form the text box will be filled with its appropriate value from the DB.

Please help.

Thanks,
Keyur
 
S

Scott L. Heim [MSFT]

Hi Keyur,

You can have your InfoPath form "pre-populate" with data by using a "Rule"
when the form opens - the main issue to note is that if there is the
potential to return a lot of data then you will want to be sure to pass
some criteria as well.

Here are some sample steps that demonstrate this using the Northwind sample
database (Access or SQL Server) and the Customers table:

- Create a new InfoPath solution from the Customers table in the Northwind
database
- Expand "queryFields" and drag the CustomerID field to the "query" area
- Right-click on the CustomerID field and choose Text Box Properties
- Set the Default Value box to: ALFKI and click OK
- Expand "dataFields" and drag the Customers group to the InfoPath form and
choose Repeating Section with Controls (you should now have all the fields
from the Customers table on your form.)
- From the Tools menu, choose Form Options
- Select the Open and Save tab
- Click the Rules button
- Click the Add button
- Click the Add Action button
- Select Query Using a Data Connection from the Action box
- In the Data Connection box, you should see the Main Connection (in this
sample, it's the only connection) - click OK four times to get you back to
the form
- Preview the form - you should see just the "ALFKI" record displayed on
the form.

I hope this helps!

Best regards,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 
K

K''''ur

Hi,

Thanks for your help, but I do not see any "Open and Save" tab in
Tools->Form Options->...

Also you said, connect to customers table in Northwind database and drag the
fields from the query fiels and datafiled dropdown, which I am assuming is to
be dragged into their respective views. But than in my actual application I
do not want to use the queryfield in the first place. As soon as the user
clicks on a link to the info path from my CRM software, the form will be
opened with that customers data already populated..

Your help will be greatly appreciated,
Thanks,
Keyur
 
S

Scott L. Heim [MSFT]

Hi Keyur,

Do you have Service Pack 1 (SP1) for InfoPath installed? You can check this
by launching InfoPath and then selecting "About Microsoft InfoPath" from
the Help menu. If you have this installed, you should see "SP1" after the
version.

If you do not have this installed, is there anything precluding you from
installing it?

Also, in regard to your process how will InfoPath "know" what customer
information to return?

Thanks,

Scott L. Heim
Microsoft Developer Support

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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