Custom script for beginners

Hello I would like to add a custom script in sales order.

As mentioned before we are mainly a service company and wanted to use the production module, it is ok using the sales order.

Now the thing is that i want to add a custom script so i can pull out information in the custom order to a new form outside the frappe, the form was created using php and html basically.

With the new information we will create the quality certificate with information inside the sales order plus information gathered during the service.

So i have to say that im new in java script Im trying to understand the code and behavior. So in sales order would like to include a form to carry out information contained inside the sales order and will only capture new data in the form outside the erpnext.

I have also include html but seems like not correctly. Can you please help me out with some lines of code how to show the form and submit button.

The data want to pull out is “customer_name”, “marca”, “delivery_date”, “sales_order_item.item_code” and “sales_order_item.qty” to mention some of them.


To integrate ERPNext with other app, frappe provides RESTapi support

Why you are not creating forms in frappe and use Only ERPNext?


Thanks for repply but still need to know how to incorporate a customized script to add a button and pull out information, the reason is that there is a lot of programing on php which erpnext do not support and it is easier to add a button to continue with something that is already done than to start from scratch,

And as lots of comments say there is not enough information to be able to move smoothly trough the system I was supposed to deliver everything six months ago and still stuck due lack of documentation, so a little help more than just read will be nice and appreciated.



even tough employees or users are not allowed to see the record of the suppliers or customers they see it in the list display this is also something that don’t help in order to deliver to the customer a all in one solution as proposed as using a custom form.

Hi @gilbester

Need more information as your question is way to generic.

  1. Where is the button supposed to be, in frappe or your php app?
  2. If it is in frappe, should the button be in the form or the menu dropdown? What you are looking for is to use $.ajax of jquery. Just google it for more info.
  3. If the button is in PHP, you need to use the rest api as @kolate_sambhaji suggested


1 Like

Hello Anand,

Thanks for responding but the bottom inside the frappe in the Sales Order form. I have tried this code but it is not working.

window.onload = function() {
document.myform.action = get_action();

function get_action() {
    return form_action;



The idea is to send somewhere outside frappe information to avoid retyping the information on the Sales Order.

Simple HTML makes errors: ‘

This paragraph

Did you figure it?

Hi @gilbester

Frappe has a different way of doing things than traditional HTML which you are trying to do.

Here’s what you can do: Frappe Cloud

Please go through the developer docs here to get a general idea about the frappe framework: Not Found and



I have read this informations before and seems like this apply only if I host on my server. But well I’m a user of the web hosted on your server, do I have access to make such applications? To be more specific do I have access to the bench?



@gilbester No we usually do not allow custom apps on the bench, but if you make one, we could add it if its okay. You will have to develop it on your local system though.