Data Connection Problem - InfoPath Dev
in

InfoPath Dev

Data Connection Problem

Last post 06-12-2008 08:17 AM by StephanieG. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 06-10-2008 09:47 AM

    Data Connection Problem

    I am designing a simple form in InfoPath 2007, connected to a SQL database. The form has two fields: one is PartNumber, the other is PartDescription. I added a rule so that when the PartNumber matches one in the database, the PartDescription will fill in automatically.

     The rule looks like this:

    Set a field's value: PartDescription = @Description [PartNumber=@StockCode].

     When I fill out the form though, the rule doesn't work. There isn't an error message or anything, the PartDescription field just doesn't fill in. Any suggestions?

    Thanks.

  • 06-10-2008 07:48 PM In reply to

    Re: Data Connection Problem

    I would do a dump of your secondary data source and check the data that is coming in.

    1 make sure you are querying the dataconnection before you try to use it.

    2 sometimes the SQL can have leading or trailing space or some other reason why the data match might not work.

  • 06-11-2008 04:21 PM In reply to

    Re: Data Connection Problem

    Thanks, I got that working. Now I have another question...

    I want to be able to fill in a partNumber (with the partDescription auto-filling), and then be able to modify the partNumber to one that isn't in the database without the partDescription changing.

    So if I put in "SP0021-02" for the partNumber, the partDescription fills in as "CR16XX SD/HD/3GIG SW". Now I want to be able to update the partNumber to "SP0021-03" (which isn't in the database), without the partDescription changing at all.

    Is that possible?

     

    Thanks again for your quick response.  

  • 06-11-2008 04:39 PM In reply to

    Re: Data Connection Problem

    Yes this is possible, you could add a condition to your rule which checks if the value is found in the secondary data and if so update but if not would fail.

    One warning, I think you are trying to create a new record based on an existing record.

    Unfortunately this will not work with the basic database connectivity.

    You will end up updating the queried record, not creating a new one in your example above.

    Just so you know.

  • 06-12-2008 08:17 AM In reply to

    Re: Data Connection Problem

    That worked beautifully, thank you.

     And thanks for the tip--the form is meant to be printed out and given to the people who have the authority to change the database after they approve the change, so I think it will be ok.

Page 1 of 1 (5 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.