Query from a Repeating Table (via WS and C#) - InfoPath Dev
in

InfoPath Dev

Qdabra® Training

Use our Google Custom Search for best site search results.

Query from a Repeating Table (via WS and C#)

Last post 07-12-2007 02:05 PM by CSSmitty. 4 replies.
Page 1 of 1 (5 items)
Sort Posts: Previous Next
  • 07-09-2007 10:05 AM

    Query from a Repeating Table (via WS and C#)

    I'm working my first relatively complex Infopath application.  This website has been a great help as I've been working with Infopath everyday for the last 2 months.

    The system lets users create new work requests.  These requests are then processed by other users who later update the requests when they are completed.  This is all done in one form with 3 different views (status of all open requests, new request form, detail of a specific request).

    The 'view' that shows the status of all open requests uses a repeating table to display a few details of each request. I then insert an extra column and insert a button (switches to the 'detail view') that would allow a user to see all of the details of that specific request.

    I had this working until I switched to web services and C#.  It was setup with Infopath talking directly to the database and JScript.

    C# WS Query Method

    VB.Net DB List Method (this is the method that actually pulls all the details of a request and populates the 'repeating table')

     

    Each request has a unique number (reqID) associated with it.  I'm trying to pull this parameter from the repeating table, query the rest of the details and switch to the 'detailed' view.

    An example of what the repeating table looks like with different data:


     

     C# Infopath Detail - OnClick Code My problem is here.

    Infopath gives the following error when I try to use the 'detail' button.

    I get a System.NullReferenceException
    Object reference not set to an instance of an object.
       at reqForm_2_0.reqForm_2_0.mainOpen_OnClick(DocActionEvent e)
       at Microsoft.Office.Interop.InfoPath.SemiTrust._ButtonEventSink_SinkHelper.OnClick(DocActionEvent pEvent)

     

    Thanks,

    -C 

  • 07-09-2007 11:51 AM In reply to

    Re: Query from a Repeating Table (via WS and C#)

    Hey there.

    Have you looked at the free download of the Database Accelerator Web Services Suite?

    Qdabra Database Accelerator Suite Version 2.0 - Developer

    It already has samples included in it that do pretty much what you are doing.  It may be helpful, instead of building everything from scratch to utilize some of these prebuilt and highly optimized web services.

    We have a catalog form which we are just releasing this month that sounds almost identical to what you are wanting to accomplish and with DBXL is has work flow, assignments, search, filtering and other features.

    If you would like a demo let me know and I could show you.  I am just thinking that we could probably have your solution working in a couple hours and it would be feature rich and you would just need to tailor your UI.

    Just a thought or at the least might be good to look at some of our services and how we use them.

    Filed under:
  • 07-10-2007 09:23 AM In reply to

    Re: Query from a Repeating Table (via WS and C#)

    Thanks for the input Clay, your app looks really slick.  I'm not interested in spending any money.

     
    I'm lost on this piece and was really hoping I could get a little bit of help.  It would be a big accomplishment for me to get this all working.

  • 07-12-2007 09:14 AM In reply to

    Re: Query from a Repeating Table (via WS and C#)

    I've been starring at this for several days now.

    I know that my problem is that I get a null value out of the repeating table.  In my case it's the reqID I need from the repeating table.  I query the rest of the details for a request from it's reqID.

    The specific piece that is returning null is:
    thisXDocument.DOM.selectSingleNode("/dfs:myFields/dfs:dataFields/ns2:getReqsResponse/ns2:getReqsResult/Reqs/_x005B_reqID_x005D_/reqID").text;

     

  • 07-12-2007 02:05 PM In reply to

    Re: Query from a Repeating Table (via WS and C#)

    I actually got this to work. The proper way to grab a value out of repeating table is: e.Source.selectSingleNode("reqID").text;

     

    So the complete line that sets up the query is:

    wsDOM.selectSingleNode("/dfs:myFields/dfs:queryFields/tns:queryReqs/tns:reqID").text = e.Source.selectSingleNode("reqID").text; 

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