Documentation About client script api

Hi, Is there any link to client script api? I need to make some things and I dont get it very clear. Thanks.

@josmediaz21,

Please check http://frappe.github.io/erpnext/user/manual/en/customize-erpnext/custom-scripts/custom-script-examples/

Thanks,
Makarand

Thanks man for ur reply, I think I wasn’t very specific in the question (My english is very poor), I am very new in ERPNext and in programming as well, but I know some things about it. I just wanted a manual very specific about the structure of the script.
E.G:

frappe.ui.form.on(“Task”, “validate”, function(frm) {
if (frm.doc.from_date < get_today()) {
msgprint(__(“You can not select past date in From Date”));
validated = false;
}
});
I know that the first parameter “Task” is the DocType, but the second one (validate) I don’t know what is for,
I need to create a charge interest on the invoice due automatically based on the due date (That’s my goal beacuse I couldn’t find anything about it), and I’m stuck in there.

the second value is event for the Task document. The validate event is called when you click on Save, Submit button.

Other than validate you can add onload, refresh and fieldname where fieldname can be any valid fieldname available in the document (this event will be called when field value is changed)

Hope this helps.

Thanks,
Makarand

1 Like

Thanks man, very useful info.

Other than validate you can add onload, refresh and fieldname where fieldname can be any valid fieldname available in the document (this event will be called when field value is changed)

Where can I find this kind of documentation?

Poor documentation is one of the big barriers that are preventing developers and companies from adopting it

Documentation is something crucial to the success of such opensource project but it its not given priority by the team

That is why also you will find lost of duplicates same questions answered repeatedly on this forum.

4 Likes

Is this the state still? We have been hunting for the documentation on what events are fired, what params are received in the handler function. We are devastated to see the lack of doc. Please, we have spent too much on this. Kindly let us know which source code to take a look at it at the least.