---
title: "Client Scripts"
space: "Wiki"
url: "https://fosserp.com/wiki/client-scripts"
updated: "2026-07-15"
---

Client scripts are code snippets written in Javascript programming language to extend or customise the standard functionalities of ERPNext.

Below are a few client scripts to hide a certain UI elements in the 'Form View'.

For more details check these resources.

1. [Blog](https://basawarajsavalagi.medium.com/form-scripting-in-frappe-framework-996c949c6b76) on Client Scrips.
2. [Documentation](https://docs.erpnext.com/docs/v14/user/manual/en/customize-erpnext/client-scripts) of Client Scripts

### 1. Hide 'Delete' and 'Move' buttons from child table rows

![](/files/0uvuFAW.png)

(Sales Invoice - DocType , Sales Invoice Item - ChildTable)


```
frappe.ui.form.on('Sales Invoice', {
    refresh(frm) {
    }
})
frappe.ui.form.on('Sales Invoice Item', {
   form_render(frm, cdt, cdn){
       frm.fields_dict.items.grid.wrapper.find('.grid-delete-row').hide();
       frm.fields_dict.items.grid.wrapper.find('.grid-move-row').hide();
   }
})
```
### 2. Hide checkboxes of child table rows

![](/files/zSsQBzu.png)


```
frappe.ui.form.on('Sales Invoice', {
    refresh(frm) {
            cur_frm.fields_dict.items.$wrapper.find('.grid-row-check').hide();
            cur_frm.fields_dict.taxes.$wrapper.find('.grid-row-check').hide();
    },
})
```
### 3. Hide 'Add Rows' button

![](/files/KlUeTGf.png)


```
frappe.ui.form.on('Sales Invoice', {
    onload(frm) {
        frm.get_field('items').grid.cannot_add_rows = true;
    }
})    


```
### 4. Hide Timeline

![](/files/mPn5xiG.png)


```
frappe.ui.form.on('Sales Invoice', {
    refresh(frm) {
        document.getElementsByClassName("timeline-items timeline-actions")[0].style.display = "none";
    }
})
```
### 5. Hide Buttons in Form View

![](/files/aODdxMW.png)


```
frappe.ui.form.on('Sales Invoice', {
    refresh(frm) {
    setTimeout(() => {
        frm.page.remove_inner_button(__('Payment'),  __('Create'));
        }, 10);
    }
})
```
