Custom script does not work on live system

Hello there,

I have a custom script that works fine on my ERPNext virtual machine but when I put on the live system it does not work.
It does not allow me to save the customer form.

Here is sample of the script http://pastebin.com/S9GSP4Eq

Your help will be greatly appreciated.

Regards,
Kat



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/18e34f74-eb08-4947-90d0-e195c027d52c%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Not an expert, but shouldn't there be semi-colon at the end of the msgprint line and doc.branch_code = 'City 4013'?

like doc.branch_code = 'City 4013';

On Thursday, February 6, 2014 3:30:44 PM UTC+8, Kat wrote:
Hello there,

I have a custom script that works fine on my ERPNext virtual machine but when I put on the live system it does not work.
It does not allow me to save the customer form.

Here is sample of the script http://pastebin.com/S9GSP4Eq

Your help will be greatly appreciated.

Regards,
Kat



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/03e1ca32-3acd-41be-98f5-06eff2113536%40googlegroups.com.

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

Hi Kat,

Seems like the Custom Fields may not be existing in your live system.

Best,
Anand Doshi.

On 6 February 2014 at 1:00:45 pm, Kat (py...@gmail.com) wrote:

Hello there,

I have a custom script that works fine on my ERPNext virtual machine
but
when I put on the live system it does not work.
It does not allow me to save the customer form.

Here is sample of the script cur_frm.cscript.custom_validate = function(doc){ if(doc.id_number != 13 - Pastebin.com

Your help will be greatly appreciated.

Regards,
Kat


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com
    and send only the URL via email
  3. 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/18e34f74-eb08-4947-90d0-e195c027d52c%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Note:

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/etPan.52f35dc4.2eb141f2.128%40macbook.local.
For more options, visit https://groups.google.com/groups/opt_out.

Hi Anand,

The fields exist in the live system but once I put the scripts live, well no way to save the form (the customer form).


On Thursday, February 6, 2014 12:02:44 PM UTC+2, Anand Doshi wrote:
Hi Kat,

Seems like the Custom Fields may not be existing in your live system.

Best,
Anand Doshi.

On 6 February 2014 at 1:00:45 pm, Kat (py...@gmail.com) wrote:
>
> Hello there,
>
> I have a custom script that works fine on my ERPNext virtual machine
> but
> when I put on the live system it does not work.
> It does not allow me to save the customer form.
>
> Here is sample of the script http://pastebin.com/S9GSP4Eq
>
> Your help will be greatly appreciated.
>
> Regards,
> Kat
>
> --
> Note:
>
> If you are posting an issue,
> 1. 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.
> 2. Paste your code at http://pastebin.com or http://gist.github.com
> and send only the URL via email
> 3. 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/18e34f74-eb08-4947-90d0-e195c027d52c%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/77fb77ec-5928-49c8-a8a0-77b754ed7642%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Lxnow,

Actually you are right, statements should end with a ;.

Thank you.

On Thursday, February 6, 2014 11:28:12 AM UTC+2, lxnow wrote:
Not an expert, but shouldn't there be semi-colon at the end of the msgprint line and doc.branch_code = 'City 4013'?

like doc.branch_code = 'City 4013';

On Thursday, February 6, 2014 3:30:44 PM UTC+8, Kat wrote:
Hello there,

I have a custom script that works fine on my ERPNext virtual machine but when I put on the live system it does not work.
It does not allow me to save the customer form.

Here is sample of the script http://pastebin.com/S9GSP4Eq

Your help will be greatly appreciated.

Regards,
Kat



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/d7c37b05-ce8f-44fb-ae62-ac13c4539ee7%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Try after clear cache and refresh

Sent from phone

On 06-Feb-2014, at 5:05 pm, Kat <py...@gmail.com> wrote:

Hi Anand,

The fields exist in the live system but once I put the scripts live, well no way to save the form (the customer form).


On Thursday, February 6, 2014 12:02:44 PM UTC+2, Anand Doshi wrote:
Hi Kat,

Seems like the Custom Fields may not be existing in your live system.

Best,
Anand Doshi.

On 6 February 2014 at 1:00:45 pm, Kat (py...@gmail.com) wrote:
>
> Hello there,
>
> I have a custom script that works fine on my ERPNext virtual machine
> but
> when I put on the live system it does not work.
> It does not allow me to save the customer form.
>
> Here is sample of the script http://pastebin.com/S9GSP4Eq
>
> Your help will be greatly appreciated.
>
> Regards,
> Kat
>
> --
> Note:
>
> If you are posting an issue,
> 1. 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.
> 2. Paste your code at http://pastebin.com or http://gist.github.com
> and send only the URL via email
> 3. 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/18e34f74-eb08-4947-90d0-e195c027d52c%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/77fb77ec-5928-49c8-a8a0-77b754ed7642%40googlegroups.com.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/3751A0D2-A13D-4825-91CB-A3D6AD5C9122%40iwebnotes.com.

    For more options, visit https://groups.google.com/groups/opt_out.
Hi Anand,

I tried that still no good result.
The script are pretty simple I don't know why they don't work.

Thanks,
Kat.

On Thursday, February 6, 2014 2:44:48 PM UTC+2, Anand Doshi wrote:
Try after clear cache and refresh

Sent from phone

On 06-Feb-2014, at 5:05 pm, Kat <py...@gmail.com> wrote:

Hi Anand,

The fields exist in the live system but once I put the scripts live, well no way to save the form (the customer form).


On Thursday, February 6, 2014 12:02:44 PM UTC+2, Anand Doshi wrote:
Hi Kat,

Seems like the Custom Fields may not be existing in your live system.

Best,
Anand Doshi.

On 6 February 2014 at 1:00:45 pm, Kat (py...@gmail.com) wrote:
>
> Hello there,
>
> I have a custom script that works fine on my ERPNext virtual machine
> but
> when I put on the live system it does not work.
> It does not allow me to save the customer form.
>
> Here is sample of the script http://pastebin.com/S9GSP4Eq
>
> Your help will be greatly appreciated.
>
> Regards,
> Kat
>
> --
> Note:
>
> If you are posting an issue,
> 1. 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.
> 2. Paste your code at http://pastebin.com or http://gist.github.com
> and send only the URL via email
> 3. 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/18e34f74-eb08-4947-90d0-e195c027d52c%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/77fb77ec-5928-49c8-a8a0-77b754ed7642%40googlegroups.com.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/2b1b7d66-6d84-40d7-9320-4d910f6c5598%40googlegroups.com.

    For more options, visit https://groups.google.com/groups/opt_out.
  1. if(doc.id_number != 13){
  2.            msgprint("ID number cannot be less than 13 characters long")
  3.         }

What do you want to check? If you want to validate number of characters in id number (>= 13 chars) as per message, then the condition should be: cstr(doc.id_number).length < 13

On 07-Feb-2014, at 4:55 PM, Kat wrote:

Hi Anand,

I tried that still no good result.
The script are pretty simple I don't know why they don't work.

Thanks,
Kat.

On Thursday, February 6, 2014 2:44:48 PM UTC+2, Anand Doshi wrote:
Try after clear cache and refresh

Sent from phone

On 06-Feb-2014, at 5:05 pm, Kat <py...@gmail.com> wrote:

Hi Anand,

The fields exist in the live system but once I put the scripts live, well no way to save the form (the customer form).


On Thursday, February 6, 2014 12:02:44 PM UTC+2, Anand Doshi wrote:
Hi Kat,

Seems like the Custom Fields may not be existing in your live system.

Best,
Anand Doshi.

On 6 February 2014 at 1:00:45 pm, Kat (py...@gmail.com) wrote:
>
> Hello there,
>
> I have a custom script that works fine on my ERPNext virtual machine
> but
> when I put on the live system it does not work.
> It does not allow me to save the customer form.
>
> Here is sample of the script http://pastebin.com/S9GSP4Eq
>
> Your help will be greatly appreciated.
>
> Regards,
> Kat
>
> --
> Note:
>
> If you are posting an issue,
> 1. 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.
> 2. Paste your code at http://pastebin.com or http://gist.github.com
> and send only the URL via email
> 3. 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/18e34f74-eb08-4947-90d0-e195c027d52c%40googlegroups.com.
> For more options, visit https://groups.google.com/groups/opt_out.
>




Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/77fb77ec-5928-49c8-a8a0-77b754ed7642%40googlegroups.com.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/2b1b7d66-6d84-40d7-9320-4d910f6c5598%40googlegroups.com.

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



Note:

 

If you are posting an issue,

  1. 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.
  2. Paste your code at http://pastebin.com or http://gist.github.com and send only the URL via email
  3. 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/0DB3E813-18FB-4D94-ABEA-3F8112FF9E2A%40gmail.com.

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

I’m facing the same problem. We have couple of custom scripts under a custom app. They work fine in the Dev boxes. But when I update my live instance, the scripts are updated though they do not work for some reason.

I have verified that all the dependent custom fields are in place. One observation, while all of them are client scripts, in the live instance (on Digital Ocean), the script types resets to ‘none’.

Thanks for your help!