web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics AX (Archived)

Web service CustCustomerService Query criteria schema

(0) ShareShare
ReportReport
Posted on by

Good evening,

We're currently using the CustCustomerService and would like to pass multiple criteria to the web service to return all customers for a particular sales group and partyCountry.  We are effectively sending:-

'QueryCriteria' => array(

               'CriteriaElement' => array(

                   array(

                       'DataSourceName' => 'CustTable',

                       'FieldName'      => 'PartyCountry',

                       'Operator'       => 'Equal',

                       'Value1'         => $country

                   ),

                   array(

                       'DataSourceName' => 'CustTable',

                       'FieldName'      => 'SalesGroup',

                       'Operator'       => 'Equal',

                       'Value1'         => $salesGroup

                   )

               )

Currently the schema appears to only accept a single element so the results are not what we expect.  Are we passing this incorrectly or is there a way to change the query schema from:-

<xsd:complexType name="QueryCriteria">

    <xsd:sequence minOccurs="1" maxOccurs="unbounded">

        <xsd:element name="CriteriaElement" type="tns:CriteriaElement"/>

    </xsd:sequence>

</xsd:complexType>

to:

<xsd:complexType name="QueryCriteria">

    <xsd:sequence>

        <xsd:element minOccurs="1" maxOccurs="unbounded" name="CriteriaElement" type="tns:CriteriaElement"/>

    </xsd:sequence>

</xsd:complexType>

Many thanks

Paulina

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Paulina, did you ever find the solution to this, I'm having the same problem.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Multiple criteria elements are supported - see an example in documentation. The schema says that the sequence can be repeated an infinite number of times.

  • Community Member Profile Picture
    on at

    I know it's allowed, my problem is consuming the webservice through PHP.

    Funny thing is, it works for the second part, where I do the update, but it does not accept it when I'm trying to select the keys.

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    PhDJ, you hijacked this thread without providing any information. If you want to discuss your problem, please tell us what exactly you're doing, what kind of error you get, how your SOAP message looks and anything you think it's important for us to know.

  • Community Member Profile Picture
    on at

    I have the exact same problem as Paulina has/had, was hoping she found a solution.

    Probably best starting another thread, although I think this is probably more a PHP "problem"

  • Martin Dráb Profile Picture
    237,880 Most Valuable Professional on at

    Well, it wouldn't make sense to ask her for details of your problem. I agree, create a new thread with all the details about your particular scenario.

    If you believe that the problem is in PHP, such as that your PHP code generates wrong SOAP messages (which indeed may be the problem), then it has nothing to do with Dynamics AX and it doesn't belong to this forum.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics AX (Archived)

#1
Martin Dráb Profile Picture

Martin Dráb 4 Most Valuable Professional

#1
Priya_K Profile Picture

Priya_K 4

#3
MyDynamicsNAV Profile Picture

MyDynamicsNAV 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans