I have a doctype called “Doc A”. I want to add a list view action button which does a couple of things. Here is my code so far:
frappe.listview_settings['Doc A'] = {
onload(listview) {
// triggers once before the list is loaded
console.log("loaded", listview);
listview.page.add_action_item('Do this', () => my_action());
}
}
Now what I want my_action to do is:
Take all selected documents and change a value in them. Let’s say I have a field called fielda. I want this button to set the value of fielda to “ABC”
Take all selected Documents and map them onto a child table link field (The link field pertaining to the selected documents. I’m guessing this works in some reverse form of a frappe call)
Create a document each for all selected Doc A and create a Doc B (another doctype with a link field to Doc A).
Any help is appreciated. Thanks.
Note: I have been trying to reverse engineer already present list view actions like “Edit”, “Delete” , “Apply Assignment Rule” but I can’t seem to find the code for it. If anyone knows where that is, that’d be helpful too.
Did you find out how to do this? I need my own list view action to operate on all selected documents in the list view and would be interested to hear how you did step 1.