InfoPath 2007 SharePoint List Data Source Filtering, Display message if no item is returned... - InfoPath Dev
in

InfoPath Dev

InfoPath 2007 SharePoint List Data Source Filtering, Display message if no item is returned...

Last post 06-10-2010 11:02 PM by Qazi Anis. 3 replies.
Page 1 of 1 (4 items)
Sort Posts: Previous Next
  • 06-02-2010 07:12 AM

    InfoPath 2007 SharePoint List Data Source Filtering, Display message if no item is returned...

    Hi,

    I have an InfoPath 2007 form which contains numerous SharePoint list data sources. There is one particular data source which I use to return a few items based on a code.

    So for example if a code is entered, let's say 67789, three further field values are returned into the InfoPath form, from a SharePoint list. The way this works is by a button with a rule, once the button is clicked, it checks to see if the code field (text box) contains a value, before invoking the data source (which is filtered on the code) and populates the three fields.

    This all works fine. However is there a way we can handle incorrect codes, so for example, if the code is not found, as opposed to doing nothing, and populating blank values, we can display a friendly message (for example, "This code was not found") ?? If so please let me know.

    It's important no custom development can be used to get arount this, only out-the-box features can be used.

    Many thanks for your help in advanced!

  • 06-08-2010 04:41 AM In reply to

    Re: InfoPath 2007 SharePoint List Data Source Filtering, Display message if no item is returned...

    Hello Adam,

    Welcome to our forums!

    You can do this in InfoPath, try the following steps:

    1. Double click on your button, click Rules.
    2. Click Add.
    3. Click Set Condition...
    4. In the first dropdown box, select the "code" field in your main data source.
    5. Select "is not equal to"
    6. In the second dropdown box, select the "code" field from your secondary data source.
    7. Click OK.
    8. Click Add Action.
    9. Select Show a dialog box message. Then enter the error message you want to display (e.g. "The code you entered is invalid. Please enter a valid code.")
    10. Once done, click OK.
    11. Click Add Action.
    12. Select Set a field's value.
    13. For the Field, select the code field in your main data source.
    14. Leave the value blank. Steps 12-14 clears the invalid data entered by user.

    Jo-Anne Alfafara
    Qdabra® Software/ InfoPathDev.com
    The InfoPath Experts – Streamline data gathering to turn process into knowledge.™
  • 06-10-2010 01:52 AM In reply to

    Re: InfoPath 2007 SharePoint List Data Source Filtering, Display message if no item is returned...

    Hi,

    I've tried adding the rule which should return an error message to the user, if no code is found, this works fine, so thank you. However this leads to another problem. Let's say for example a code is returned, it still displays the error message. Essentially it's returning the error message regardless of if a code is returned or not. The rules within my button are structured as the following;

    RULE 1) QUERY DATASOURCE

    RULE 2) INVALID CODE (Data Source Code != Form Code)

    - Show dialog box (Incorrect code)

    - Set fields value to ""

    RULE 3) RETURN CODE (Data Source = Form Code)

    - Set fields value: location = @location[Form Code = @Data Source Code]

    Can you see any obvious errors with this?

    Many thanks for your help.

  • 06-10-2010 11:02 PM In reply to

    Re: InfoPath 2007 SharePoint List Data Source Filtering, Display message if no item is returned...

     the obvious error in your rules is that you are trying to compare the form code with the whole of "data source code" with out filtering. you will need to filter data source code

    Qazi Anis
    Technical Architect
    Bitwise Inc
Page 1 of 1 (4 items)
Copyright © 2003-2019 Qdabra Software. All rights reserved.
View our Terms of Use.