Error on client script sql function

I’m having error when trying to filter based on year as codes below:{
    method: 'frappe.client.get_list',
    args: {
        'parent': 'Expense Claim',
        'doctype': 'Expense Claim Detail',
        'filters': [
            ['expense_type','in',['Medical','Additional Medical']],
    callback: function(r) {

This just gives me error as image below:

May I know what is the correct way to filter based on year on particular field?

Hi @muhdazwa,

Please check the references.

Another reference:

I hope this helps.

Thank You!

Hi @NCP ,

Actually I’m trying to use sql function to extract year from field expense_date which is a full date but it seems Frappe doesn’t like sql function usage in the filters.

Client side, maybe it’s not possible but server side it’s possible.

Please check it: Database API

Please read the whole documentation.

I hope this helps.

Thank You!