Delete child list data table records

Dear Plumsail Support Team,
I have a specific scenario as following:
I created a form A for a main list A and within the same form A, there is a sub form (list control) for another list B.
The list A is the parent form and the list B is the child list form.

Our concern is to delete all the records in the child list B using a trigger button in the form of the list A instead of deleting each record alone and for sure must be deleted from the list B.

I think that the child list B is a data table type and it should be a solution like a loop!

Would you please guide me to get suitable script for this scenario?
thank you
2019-01-19_16-13-07

Dear Georges,

Seems pretty doable! :grin:

You can delete items from the list B using PnP JS:https://github.com/SharePoint/PnP-JS-Core/wiki/Working-With:-Items (it’s already built in Forms).

After that - refresh data table:

fd.control("SPDataTable0").refresh()

And hide a column with “delete” option:

fd.control("SPDataTable0").widget.hideColumn(0)

Notice that “hideColumn(0)” uses zero-based index of the columns.

Let me know if you have any troubles with code or need any help!

Thank you AlexZver for your generous information i will check and test the script and get back to you in case of any other needs.
cheers