a!deleteFromDataStoreEntities within onsuccess a!writeToDataStoreEntity in a WebApi

Hello,

 I have a problem in a webApi.

I have to put inside onSuccess of a!writeToDataStoreEntity  a a!deleteFromDataStoreEntities. When I execute it, the deletion in the database is correct but the web api returns an error 500  besides this error:

Not a valid Web API Response. Received: [Lcom.appiancorp.core.data.Record;@2a857aff.

The code is:

a!writeToDataStoreEntity(
dataStoreEntity: cons!TABLA_PRUEBA,
valueToStore: local!Datosguarda,
onSuccess:
with(


a!deleteFromDataStoreEntities(
dataToDelete: {
a!entityDataIdentifiers(
entity: cons!TABLA_PRUEBA2,
identifiers: local!idToDelete
)
},
deletionComment: loggedInUser() & " deleted id " & local!idToDelete,
onSuccess: a!httpResponse(
statusCode: 200

),
onError: a!httpResponse(
statusCode: 500,
headers: {
a!httpHeader(
name: "Content-Type",
value: "application/json"
)
},
body: a!toJson(

error:"There was an error writing to the data store"
}
)
)
)


),
onError: a!httpResponse(
statusCode: 500,
headers: {
a!httpHeader(
name: "Content-Type",
value: "application/json"
)
},
body: a!toJson(
{
error:"There was an error writing to the data store"
}
)
)
)

Do you know why this happens?

Regards, and thank you very much

Parents Reply Children
No Data

 Discussion posts and replies are publicly visible