Accessing DataSource via Web Service - Error when no matching results - InfoPath Dev
in

InfoPath Dev

Use our Google Custom Search for best site search results.

Accessing DataSource via Web Service - Error when no matching results

Last post 06-11-2014 08:08 AM by MikeH. 0 replies.
Page 1 of 1 (1 items)
Sort Posts: Previous Next
  • 06-11-2014 08:08 AM

    • MikeH
    • Not Ranked
    • Joined on 06-11-2014
    • Posts 3

    Accessing DataSource via Web Service - Error when no matching results

    Hi All,

    Any advice/suggestions would be much appreciated on the following issue I am experiencing. 

    Overview:

    I am trying to get a count of the matching WinAccounts from a datasource via a Web Service.  So a user opens the form, they click Get Count, the form accesses a datasource and finds how many matches there are for the current form user.

    If there is a match then a count is successfully returned which is great - exactly what I want.  However if there are no matches, an error is displayed.  It needs some kind of error handling for the event that there are no matches. 

    Error:

    The query cannot be run for the following DataObject: GetContact
    InfoPath cannot run the specified query.
    The SOAP response indicates that an error occurred on the server:

    Server was unable to process request. ---> Failed to Get Contact for User1 ---> Failed to Get Contact for  User1 ---> Failed to get contact details for  User1
     ---> Failed to get contact details for  User1

    Details:

    I have 1 field called Count.

    I have 1 DataConnection called GetContact.  This is a RECIEVE connection using a webservice.  The DataSource has 2 columns, ID and WindowsAccount

    I have 1 button on the form called 'Get Count'.

    I have 3 rules on the button Get Count as follows:

    Set query field for web service to current form user

    • Set a fields value: WindowsAccount (a query field on GetContact Data Connection) = userName()

    Execute Query

    • Query using a data connection:GetContact

    Get Count

    • Set a fields value: Count = count(ID)
Page 1 of 1 (1 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.