Form grinds to a halt after database look-up - InfoPath Dev
in

InfoPath Dev

Form grinds to a halt after database look-up

Last post 10-27-2008 07:52 AM by Jimmy. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 10-24-2008 12:37 PM

    Form grinds to a halt after database look-up

    Hi All,

    I have a form on which a user enters an employee number and a query brings back corresponding payroll information.
    The data resides in a single SQL Server table of about 5000 rows.  There are no indexes.
    I have created rules on the employee number field to look up the information using a secondary data source.
    The secondary data source is part of the form and not on a sharepoint site.

    After I enter the employee number it brings back the information correctly, but form grinds to a halt.
    Moving from field to field is in slow-motion.
    When I submit the form, I get the following error:

    Stop running this script?

    A script on this page is causing Internet Explorer to run slowly.

    If it continues to run, your computer may become unresponsive.

    Y/N

    Any ideas?

    Thanks,
    Dave
     

  • 10-24-2008 06:18 PM In reply to

    Re: Form grinds to a halt after database look-up

    Are you querying the entire table every time? If so, the form is probably running slowly because you have so much data in its DOM.

    Perhaps you could consider querying only a portion of the table as necessary.

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
  • 10-27-2008 06:41 AM In reply to

    Re: Form grinds to a halt after database look-up

    Hi Jimmy,

    The rule is as follows:

    xdXDocument:GetDOM("Colleague_Information")/dfs:myFields/dfs:dataFields/d:Colleague_Information/@last_name[../@employee_number = current()]

    There is no other code involved.

    thanks,

    Dave

  • 10-27-2008 07:52 AM In reply to

    Re: Form grinds to a halt after database look-up

    I can't be sure, but it sounds like the form is running slowly because it is weeding through the entire 5000 row table in your secondary DOM when the rule is run.  You may want to consider instead running an SQL query to get the employee you want, and not store the whole table in your secondary DOM.

    For examples of how to do this, please see:
    http://www.infopathdev.com/forums/p/9467/33496.aspx#33496
    and
    http://www.infopathdev.com/forums/p/8940/31780.aspx#31780

    Jimmy Rishe / Software Developer / Microsoft MVP
    Qdabra Software
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.