Custom Scripts

I Erpnext Team.

I would like to know if there is another way of integrate client side script in a core doctype instead of custom scripts.

I mean, to write a little script it is ok, but a medium script it is not.

I constantly copy and past from my ide to the space of custom script. 

Can i make something like this?:

<% include path/to/my/script/somefile.js %>

In this particular case i'm trying to do some custom script in Customer doctype.


Thanks.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cf286164-87ae-4287-ae17-18fa1a5778cb%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.
It shall auto add <script> tag around wrote script. If it is your include js, i'm afraid the browse will just take it as a txt instead of script.

I didn't try. you can see custom script sample https://erpnext.com/user-guide/customize-erpnext/custom-scripts/custom-script-examples



在 2014年9月19日星期五UTC+8上午2时09分13秒,Luis Fernandes写道:
I Erpnext Team.

I would like to know if there is another way of integrate client side script in a core doctype instead of custom scripts.

I mean, to write a little script it is ok, but a medium script it is not.

I constantly copy and past from my ide to the space of custom script. 

Can i make something like this?:

<% include path/to/my/script/somefile.js %>

In this particular case i'm trying to do some custom script in Customer doctype.


Thanks.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/8b014845-7aec-4ec6-ac6d-a6d32d5590fb%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.

On 18-Sep-2014, at 11:39 pm, Luis Fernandes <lu...@gmail.com> wrote:

I Erpnext Team.

I would like to know if there is another way of integrate client side script in a core doctype instead of custom scripts.

I mean, to write a little script it is ok, but a medium script it is not.

I constantly copy and past from my ide to the space of custom script. 

Can i make something like this?:

<% include path/to/my/script/somefile.js %>

2 options:

1. Add it in hooks.py of your file as "app_include_js"

see: https://github.com/frappe/erpnext/blob/develop/erpnext/hooks.py#L11

2. Create a build .json for your app and build it along with erpnext.min.js

see: https://github.com/frappe/erpnext/blob/develop/erpnext/public/build.json




In this particular case i'm trying to do some custom script in Customer doctype.


Thanks.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups “ERPNext Developer Forum” group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/cf286164-87ae-4287-ae17-18fa1a5778cb%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/C3100B2E-A071-43C2-B7C5-CA22848D02C6%40gmail.com.

    For more options, visit https://groups.google.com/d/optout.
Thank you both. I will try second option of rushabh. It seems the perfect option for what i want.


Quinta-feira, 18 de Setembro de 2014 19:09:13 UTC+1, Luis Fernandes escreveu:
I Erpnext Team.

I would like to know if there is another way of integrate client side script in a core doctype instead of custom scripts.

I mean, to write a little script it is ok, but a medium script it is not.

I constantly copy and past from my ide to the space of custom script. 

Can i make something like this?:

<% include path/to/my/script/somefile.js %>

In this particular case i'm trying to do some custom script in Customer doctype.


Thanks.



Note:

 

If you are posting an issue,

 

  1. ERPNext is a free and open source software and support is given on this forum by a team (https://frappe.io/webnotes). So please consider donating if you find this forum useful (https://frappe.io/buy). Even a small amount would be helpful.
  2. We should be able to replicate it at our end. So please give us as much information as you can. Please see it from the point of view of the person receiving the communication.
  3. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  4. For sending images, use http://imgur.com or other similar services. Do not send images as attachments. Links are good. Same goes for any file you are going to send.

     

    End of Note



    You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.

    To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-developer-forum+un…@googlegroups.com.

    To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/e582234a-ba08-48e9-97dc-869d7d015163%40googlegroups.com.

    For more options, visit https://groups.google.com/d/optout.