Script from listbox - InfoPath Dev
in

InfoPath Dev

Script from listbox

Last post 08-28-2005 04:16 PM by Mik. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 08-24-2005 08:27 PM

    • Mik
    • Not Ranked
    • Joined on 08-15-2005
    • Australia
    • Posts 16

    Script from listbox

    I need script to execute once a listbox entry has been selected, but you cannot set script execution in a rule.

    I have worked out how to do a conditional sql query using the default data connections string, that all works fine. The data connection is used to populate a list box, in which the contents will populate furthur listboxes. I can set a rule to query a database, but i cannot set that query to be conditional on the first list box. I could connect to the entire table and then filter what i need, but there will be over 1000 rows, and some slow remote sites which will use the form.

    In practice, the list box that i have populated represents a manager, and the second list box will be their subordinates.

    But back to the question.. how do you map script to a list box selection? (or set a default sql query to conditional on a field)
  • 08-25-2005 03:29 AM In reply to

    Hi Mik,
    Did you try onAfterChange Method?
    You can write code in onAfterChange method.

    One more thing you can have conditions on a rule when to execute and not execute. In this conditions you can call a script method also using "xdExtension".

    For further info on "xdExtension" do a search in the site.

    Agni
    InfoPath Dev India
  • 08-25-2005 08:00 PM In reply to

    • Mik
    • Not Ranked
    • Joined on 08-15-2005
    • Australia
    • Posts 16
    That helped alot thanks, I used the OnAfterChange.. my problem now is that the variable used in the first list box isnt being written to a node (its populated by a secondary data source) before the script is run.. i think.
    This means that the variable I am putting into the query, that is in a field in my form, is empty and thus returning sql errors.

    Any thoughts?
  • 08-28-2005 04:16 PM In reply to

    • Mik
    • Not Ranked
    • Joined on 08-15-2005
    • Australia
    • Posts 16
    Forget that, it was the DB peoples problem.
    Ive got to remember to check that a query returns a value before I try to implement it.
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.