Skip to main content
16-Pearl
May 16, 2024
Solved

Deletedatatableentrieswithquery delete the entries from Datatable

  • May 16, 2024
  • 1 reply
  • 1220 views

how can i delete the entries which are created before 30 january 2020. its giving me error 

 

 

Jamal8548_1-1715856626621.png

 

Best answer by Rocko

This works for me:

me.DeleteDataTableEntriesWithQuery({
query: {
 "filters": {
 "type": "LT",
 "fieldName": "d",
 "value": "2024-05-14T12:43:13.000Z" }
}
});

1 reply

Rocko
19-Tanzanite
May 16, 2024

You can't call Javascript functions in JSON. Try a date notation like this

2012-04-23T18:25:43.511Z

Also, I think there should be surrounding curly braces to make it an object.

{"filters": ...}

MA873117416-PearlAuthor
16-Pearl
May 28, 2024

Would you like to test on your end may be you can create few entries in datatable and try to delete it with Deletedatatableentrieswithquery service. the field qualityCheckTimestamp is of Datetime format. I have tried different ways and even if try 2012-04-23T18:25:43.511Z this format also but no it just does not work. I want to delete all the entries which are created before a specific date which i pass in query. 

 

{
 "filters": {
 "type": "LT",
 "fieldName": "qualityCheckTimeStamp",
 "value": "2024-03-12"
 }
}

 

Rocko
Rocko19-TanzaniteAnswer
19-Tanzanite
May 28, 2024

This works for me:

me.DeleteDataTableEntriesWithQuery({
query: {
 "filters": {
 "type": "LT",
 "fieldName": "d",
 "value": "2024-05-14T12:43:13.000Z" }
}
});