How to add totally customized code for the doctype

Hello All;

For example, if I need to add something special in the doctype, like new table (not same current existed table in erpnext) with totally new code, colors and actions, something can not be done using the current allowed fields. How to do this?

Regards
Bilal

You can use a Custom Field to create a new table. Check this link for more info:
You can look into here : Custom Field

To add custom code, you can use a Client Script or a Server Script:
https://docs.frappe.io/framework/user/en/desk/scripting/client-script
https://docs.frappe.io/framework/user/en/desk/scripting/server-script

No, I do not mean like this.
How I can create a table using html and javascript? I need to build the table with special features, shape and color … I do not need to have table like the table that are used in the doctype.

Regards
Bilal

Hi @bghayad:

Add an HTML field on your doctype. With client script (or .js file) “inject” content to the field with something like that:

html = '<table>
  <tr>
    <th>Company</th>
    <th>Contact</th>
    <th>Country</th>
  </tr>
  <tr>
    <td>Alfreds Futterkiste</td>
    <td>Maria Anders</td>
    <td>Germany</td>
  </tr>
  <tr>
    <td>Centro comercial Moctezuma</td>
    <td>Francisco Chang</td>
    <td>Mexico</td>
  </tr>
</table>'

frm.fields_dict.your_html_field.html(html);

Check this for reference.

Hope this helps.