Skip to Content
0

$filter is not working in OData URL

Jul 13, 2017 at 09:19 AM

221

avatar image

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)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

5 Answers

avatar image
Former Member Sep 04, 2017 at 06:24 AM
1

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

Share
10 |10000 characters needed characters left characters exceeded
Akhilesh Upadhyay Jul 13, 2017 at 12:13 PM
0

Hi,

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

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

Show 4 Share
10 |10000 characters needed characters left characters exceeded

Hello Akhilesh,

for this URL

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

All type of status are coming (like Open,Completed ).

This URL is not working properly.

0

since filterable is already checked,

1) sometime it takes time to update metadata and apply newly changes (filterable) if you have changed recently, you should wait till get the metadata updated or you can try clearing caches n all.

2) you can check the backend code.

0

Hi ,

I have checked in backend code. There are no code available for the filed StatusTxt .

So , i think we should enhance the backend code.

0

Yes, do code respectively..

0
Ashwin Narayan Jul 14, 2017 at 12:40 PM
0

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

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hello Ashwin,

The values are coming as 'Open' ,'Completed' etc

I have checked also 'open'. But no result.

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

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'

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Hi Vivek,

I have already used this. But its not working.

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

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

Share
10 |10000 characters needed characters left characters exceeded