How can I know which index of table

I created a custom button for a table.
When I click on this button, this will run a function. But, I need know what’s the index of table which the button was clicked, cause each index has different informations.

any help?

can you elaborate your question

The button “orçamento” create a new quotation by script, the quotation will receive some datas of the index.
How can I get the datas of the actual index when I click on the button?
In this case, it’s row #1 (index 0), but I need know which is the index by script, how can I do that?

you need that OS value when clicking Orcamento button,is it so??

@Leonardo_Augusto, Refer following example -

frappe.ui.form.on("Child Table Name", "button_name", function(frm, cdt, cdn) {
	var d  = locals[cdt][cdn];
    console.log(d.os)
    // Your Code
});

You can access that row values like d.item_code and so on …

1 Like

I need know witch’s the index of array what client-side was clicked

Niiiiiiice! That’s it