If i try to delete this it's showing an error like this. How can sort out this?
Hello Farhan, So, if it is not a delete from the database, what exactly does the DeleteSubmitRequest? Does it changes the value of a flag/boolean like "IsDelete"?What exactly do you expect to be the behavior of the ListRemove? Once again, it seems that you are changing the value/remove something on the server action, than you try to do an other operation on the same record you change (meaning, trying to remove that exactly records, which is why an error is raising) and after that refresh the aggregate. And after that, you will refresh the same list. It seems to me that you don't need the ListRemove...Best regards, Ana
Hi Farhan,
it appears you are trying to remove a record that is no longer on that list.
If you debug and check the list elements, you can see the position of each item, if any.
Regards,
Paulo Z
While debugging swipe action is not working in ListItem (ListAction).
Hello Farhan Ammer, Like @Paulo Zacarias said, you have a delete action before the list remove. So, as soon as you delete a record, it will not exist anymore. So, it is automatically removed for the list. I believe you don't need to use the list remove. Take off from your flow the ListRemove and check again if you are or not able to have the expecting behavior you desire. Best regards, Ana
It's not deleting from the database
I have removed the ListRemove action, Now i am having only delete server action in that server action submit_request is not deleting from the database.
Hello again Farhan,
Now the problem is different, it is not the one you posted anymore. You now stopped having the error "Index out of Bounds, Index 0 for empty list", meaning, the main issue was sorted.
Anyway, it is not deleting because you have something wrong inside of the server action. Try to apply debugger on the flow of the DeleteSubmitRequest then to understand better what is missing/wrong.Best regards, Ana
Hi @Farhan Ameer
As i see in your attached screenshot you are passing Id or a runtime property in ListRemove position attribute (it's not clear visible),
Since, it's expect a position of the element in list which you want to delete,
Lets consider a case, suppose this is your list data -
Id Name
1 First
4 Second
5 Three
So if you want to remove second element from the list then you need to pass 1 as value in Position parameter, List always start indexing from 0,
I hope it'll help you.
Thanks
Deep