Delete in entity-storage

Hi Team,

Good day!

We have tried to delete the data from the entity storage but the flow keeps on entering into the catch method even if the data is removed!

Is this a bug?

If so is there any work-around to get this fixed?

Kindly let us know.

Thanks,
Benny

1 Like

Can you share the code you used for the delete method along with any screenshots of the error?

Hi @kaustavdm

I can confirm that similar issue is faced by me as well while deleting the record from entity storage.

2 Likes

Hi @kaustavdm,

Please find the code below.


const deleteTask = async(display_id) => {
    console.log("display_id " , display_id)
    try {
        const taskEntity = $db.entity({ version: "v1" }).get("tasks");
        await taskEntity.delete(display_id);
        return [false, `${display_id} removed successfully!`];
    } catch (err) {
        console.log(
            `[Custom Objects] Unable to remove task. Reason: ${err.message}`
            );

            console.log(err)
        return [true, {msg:`unable to remove ${display_id}: ${err.message}`, status : err.status}]
    }
}

The flow enters into catch, the err parameter in the catch is undefined.

Please let me know if you need any other data.

Thanks,
Benny

1 Like

Thanks for the code sample, @Bene_Immanuel, and for the confirmation @Sachin_Kumar. This helps a lot. I am able to reproduce this issue, though intermittently.

I’ll work with our engineers to debug this further. Thank you for bringing this to our attention.

1 Like