Hello Experts,
I have created a custom solution with a node that is binding to advance list pane. For this I have also provided an DeleteBin Icon on every row so that user can delete the specific record. Refer the below screenshot:
As of now irrespective to which record I try to delete, first one which is marked in red above gets deleted. In my Event Handler, I have added BOAction that has instance Binding to my DataList but somehow I can see in debug that all the 4 records are picked up and maybe that why my below line of code in my Action deletes first record:
this.fieldRules.Delete();
Kindly throw some lights how I will be enabling deletion of the selected record.
Thanks & Regards,
Chandan
Hi Chandan,
Make sure that you have followed all the given steps:
Hope this works for you.
As per my knowledge,there is no need of custom action to delete.
Regards,
Komal
Hi Chandan,
It seems you added the BOAction in the root node in business object definition.
You have to add the BOAction in the fieldRules node.
->this.fieldRules.Delete();
It is a bit strange that your code doesn't have a GetFirst() even you are accessing the instance of the fieldRules node.
Best Regards,
Fred
Hello MOHD SIRAJUDDIN, Komal Choudhary & Fred K,
I switch to try again the Event where I have used (same that was suggested by Komal and Siraj):
1. RemoveRow method for List.
2. Save
3. Refresh the List.
I worked fine now. Maybe I forgot to maintain the Target List in the third step (List Refresh) that threw the dump earlier. Now the delete icon that I click, deletes the same row it is in and refreshes the List after saving. 😊
Only one issue now. I had 4 rows in my ALP. I deleted all one by one for testing. All worked as expected, unless there was only one row left. When I deleted this row, I could see some processing on screen followed by Save. But I can still see the left row on screen. Technically the row was deleted, but still visible on screen!!
When I try to delete it again, it throw dump (as expected since row was already deleted) When I reopen the same record again. I can now see my ALP empty as expected.
Any suggestion why this happens and how I will handle this situation?
Your inputs on this discussion was really very valuable for me to learn and I am sure for many in future.
Thanks for replying folks. 😊
Regards,
Chandan
Hello Chandan,
If you are using Delete Bin icon for deleting the selected record then no need of custom action just follow.
1. On Delete bin icon onclick event create Event handler.
2. Select list operation from the list of events available.
3. Select operation as remove row
4. Select the target list (your node data list);
4. And also include another event windows action and select the action type as save it will save the entries after record gets deleted.
Thanks,
Siraj.
Add a comment