ERPNext Foundation ERPNext Cloud User Manual Blog Discuss Frappé* Donate

How to add custom script files in custom app?



I have make some custom script under fixture folder in custom app.
fixtures/Purchase Receipt.js
fixtures/Purchase Order.js

But it’s not working. How can i add the custom script files with my custom application? I have seen . Here he didn’t add anything in file.

So how is this custom script working?

Overwriting Student Attendance Tool
Custom app to change core frappe files

Have you tried to bench migrate ?


Sorry, @munim

Your issue that you dont have the correct file structure… Assume that you app in called “MYAPP”


You are missing the custom_scripts folder.
Also after any change you need to run bench migrate



Hi munim

edit of your app

   doctype_js = {
        "Purchase Receipt": "custom_scripts/purchase_receipts_custom.js",
        "Purchase Order": "custom_scripts/purchase_order_custom.js"

If not edit

You must copy these scripts into custom script page

/desk#List/Custom Script/List


Thanks, after giving bench migrate, it’s working now.

Finally i have done

  1. In i have added
    doctype_js = {
    “Purchase Receipt” : “custom_scripts/Purchase Receipt.js”,
  2. I have made the file path myapp/myapp/fixtures/custom_scripts/ Assume that my app in called “MYAPP”
  3. At last bench migrate.

Thanks @kickapoo and @vinhnguyent090


@munim I just want note (and for others that will check this setup), It is not necessary to have anything to if you use the correct path “myapp/myapp/fixtures/custom_scripts/.js”


(post withdrawn by author, will be automatically deleted in 24 hours unless flagged)