Closed Florin1335BP closed 1 month ago
Hi @Florin1335BP ,
Thanks for raising this. I believe there is an issue in how we serialize Edm.DateTime
fields for the URI. I'll create a ticket to investigate and fix this.
In the meantime, you could try to use custom de-serializer to add the null filter. You can find the docs here
Maybe adding a null check like:
'Edm.DateTime': {
deserialize: deserializeToMoment,
serialize: serializeFromMoment,
serializeToUri: value =>
value == null ? 'null' : `datetime'${value.toISOString().replace(/Z$/, '')}'`
},
Hey @deekshas8, I tried that and it's working fine now. Looks like I can get away with defining only serializeToUri since I'm doing a GET request with executeRaw, so no need for deserialization and serialization. Since the solution is documented I'll go ahead and use it, thank you very much!
Hi,
I was trying to apply a not null filter for a datetime field, through the oData v2 client API and I'm getting an error, it looks like the value must be a moment date object only.
DATETIME_FIELD.notEquals(null) -> Error: Cannot read properties of null (reading 'toISOString') in @sap-cloud-sdk\odata-v2\dist\de-serializers\default-de-serializers.js
Is there a way I can apply such a filter or is this not supported?