Skip to Content

$filter is not working in OData URL

Hello Team,

I have one issue in CRM My Appointment App.

In this App tile i have to display Number of Open Appointments.

so i have used this URL ,

/sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet/?$filter=StatusTxt eq 'Open'

But here i am not able to see only 'Open' Appointments. It will display all appointments.

I have checked in gateway Service Builder , the filed StatusTxt is filterable.

Can you please help me on this?

statustxt.jpg (19.9 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

5 Answers

  • Sep 04, 2017 at 06:24 AM

    It seems that you are dealing with standard CRM Appointment app,

    Hence I'd suggest you to debug the code in DPC_EXT as the OData service returns all types likewise OPEN, Completed, etc.

    -PG

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 13, 2017 at 12:13 PM

    Hi,

    try putting $count before ?$filter, for example,

    ......./$count?$filter=......

    Add comment
    10|10000 characters needed characters exceeded

  • Jul 14, 2017 at 12:40 PM

    Hi Deborishi,

    The filter looks fine to me. Can you please check the StatusTxt value? Is it supposed to be Open or is there a different value or difference in case (upper/lower).

    Good Luck !!

    Thanks,

    Ashwin

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 14, 2017 at 05:43 AM

    Hi Deborshi,

    Try removing forward slash '/' after your entityset and try again it will work. Like below

    /sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet?$filter=StatusTxt eq 'Open'

    Add comment
    10|10000 characters needed characters exceeded

  • avatar image
    Former Member
    Jul 18, 2017 at 02:28 PM

    Hi Deborshi,

    The query you are using is correct.
    /sap/opu/odata/sap/CRM_APPOINTMENT_SRV/AppointmentSet/?$filter=StatusTxt eq 'Open'

    Now, you have to check whether the filter condition you have written in your DPC_EXT is on 'Open' text. Any case mismatch will not fetch data. Also, it is important to know what error you are getting. If you are getting a correct response then probably something is wrong with your method coding.

    Regards,

    Saswata

    Add comment
    10|10000 characters needed characters exceeded