Hello guys. I’m a beginer in erpnext. I created a custom Doctype. Now I want to add service side script and client side script but I don’t know where to start. I pulled erpnext repo and read some but i can’t understand all ideas of scripts. So, please let me know how to write scripts and explain ideas for writting scripts for me. Thanks all.
First you need to allow developer mode in your site then start writing the script. For that go to your setup folder in that frappe-bench>sites>your site name>site_config.json, open this file site_config.json and add
“developer_mode”: 1 below your db_password like this:
For client side you need to write code in custom script and for server side you need to make script report and in back-end you will get .js file and .py file for writing code
Yes. Thank you. But i don’t know how to write it. what i mean that i don’t know the content of scripts file. what idea should i write. i read some erpnext module but i don’t understand what they wrote.
Try with something simple:
validate event will trigger automatically when you save the document. It is the default event of frappe just like ‘onclick’ in html
-------on .js file----------------------
here you can find more about client side triggers:
These links will help
Yep. I read all documents above. But, i actually want to ask that the content of script files. what standard should i follow to wirte? Because I don’t know what things i should write from begin to end.
You can follow the standard of ERPNext files itself. Once you read a few Python/JS files you will get the hang of it.
Here is something important to know : Frappe Hooks
I would recommend to try following these basic tutorials before you build a project by yourself , scripting becomes a lot more easier follow these steps and once you get the functionality you can understand and write the scripts fluently , thanks .