Hello everyone!
Started using ERPNext just yesterday and I want some customisation on my system.
I want to write a script which would let me create a Custom button on the Homepage, but I am confused about what DocType to use and the ApplyTo.
Please help me.
Which DocType to select to make the Button appear on the Home Page?
1 Like
i think you can do it using custom app then add your script to the app_include_js hook
Hello @erpnextnoob1 , did you find the solution, please?
Hi @erpnextnoob1
The class of that section is “page-actions”, you can insert the element you want.
Eg:
Add the JS file to app_include_js hooks or u can make it as bundle.
In the JS on the onload of window.
$(window).on('load', function () {
if (window.location.pathname == "app/home") {
const actions = $(".page-actions");
const already_added = $("#new_action");
if (!already_added) {
actions.prepend("<h1 id=`new_action`>Hi</h1>");
}
}
});
You can replace this to a button or anything.
Output:
Thanks & Regards
1 Like
Hi @shubham2025
Check the comments
I have a Question Where to add ? this code .