cancel
Showing results forĀ 
Search instead forĀ 
Did you mean:Ā 
Read only

Setting default date in smartfilterbar field not working

SAPSeeker
Participant
0 Likes
477

Hi Experts,

I am default value for date field in smartfilterbar which is working fine. But when I try to click on F4 searchhelp to replace the date field value, error message is shown in console which doesn't allow me to proceed further. Can someone help me to fix this issue ?

Error message is  {name: 'FormatException', message: 'Illegal sap.ui.model.odata.type.DateTime value: '}

SAPSeeker_0-1740082723414.png

Code that is used in filter initializing method to display default date:

SAPSeeker_2-1740083083192.png

Error in console:

SAPSeeker_1-1740082908195.png

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

axel_brke3
Participant
0 Likes

Do you want to set a fixed date? This is how we did this for the last week:

 var oDefaultFilter = {
                "createTimestamp": {
                    "conditionTypeInfo": {
                        "name": "sap.ui.comp.config.condition.DateRangeType",
                        "data": {
                            "operation": "THISWEEK",
                            "value1": null,
                            "value2": null,
                            "key": "createTimestamp",
                            "calendarType": "Gregorian"
                        }
                    }
                }
            }
            oSmartFilter.setFilterData(oDefaultFilter);
SAPSeeker
Participant
0 Likes
Thanks Alex. But I am looking to solve an issue I face after setting this value. ie, when I try to click search help icon, console shows error and search help dialog isn't showing.