updating secondary datasource/rule... BIG PROB!! - InfoPath Dev
in

InfoPath Dev

updating secondary datasource/rule... BIG PROB!!

Last post 02-26-2007 08:57 AM by Shiraz Cupala. 1 replies.
Page 1 of 1 (2 items)
Sort Posts: Previous Next
  • 02-23-2007 11:32 AM

    updating secondary datasource/rule... BIG PROB!!

    Below is a description of my problem, keep in mind i am using infopath 2007 with visual studio 2005, my form is hosted in the formControl in a windows application.

    I have a combobox that has a rule set up against it to check to see if the value entered matches any of the values in a secondary datasource. If it does not i pop up a message, if it does it populates the selection. I am doing this because i have a treeview control in my visual studio project and if the selection of the treeview control matches any of the values in my combobox (i.e. the secondary datasource) i want the value of the datasource to fill the combobox, if it does not i pop up an error message. This works beautifully.. The problem occurs because the users have the option of manually entering a value into the combobox, when they do this i update the secondary datasource so that the value will be in the list of values in the combobox however the rule fires BEFORE i ahve a chance to refresh the data connection with the newly added value so the error message always pops up, i use
    this.DataConnections["Assets"].Execute();

    in the context changed method of my form to update the datasource and the value does appear in the box after i do this however the RULE i have set up fires BEFORE the context changed method so the newly inserted value isn't in the datasource yet hence the error message... Is there anyother place i can refresh my datasource BEFORE the rule fires so that the combobox will contain this newly added value at the time the rule fires?
  • 02-26-2007 08:57 AM In reply to

    Re: updating secondary datasource/rule... BIG PROB!!

    A very interesting scenario. I'm thrilled to hear you're using the hosted InfoPath control. In this case, you may need to replace your rule with code to display the dialog because the event firing order can't be further controlled. By putting your dialog in code you will be able to handle the ordering yourself.

    Also, I'm curious on your scenario for hosting InfoPath. Please share if that's ok.

    Cheers, Shiraz
    Shiraz Cupala / Microsoft InfoPath MVP
    Qdabra® Software / Streamline data gathering to turn process into knowledge
Page 1 of 1 (2 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.