Client Scripting: Condition for Customer Issue not New

Hi, can someone help me how to set condition for an IF statement that checks if the status of a Customer Issue form (non-submittable form type) is *not* new? 

I am trying this:

    cur_frm.set_df_property("field_name", "read_only", doc.name != null);

But it doesn't see to work. Is doc.name not the right field to refer to the form ID? I've also tried doc.ID != null but that doesn't work either.



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.

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

Please use:
cur_frm.set_df_property("fieldname", "read_only", !doc.__islocal)

-Anand.



On Thu, Dec 5, 2013 at 1:21 PM, lxnow <la…@union.ph> wrote:

Hi, can someone help me how to set condition for an IF statement that checks if the status of a Customer Issue form (non-submittable form type) is *not* new?

I am trying this:


cur_frm.set_df_property("field_name", "read_only", doc.name != null);

But it doesn't see to work. Is doc.name not the right field to refer to the form ID? I've also tried doc.ID != null but that doesn't work either.



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.

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.

    For more options, visit https://groups.google.com/groups/opt_out.
Thanks, I understand better now.  !doc.__islocal is the condition to say its NOT local copy only, i.e. not new.

On Thursday, December 5, 2013 4:46:40 PM UTC+8, Anand Doshi wrote:
Hi Laurence,

Please use:
cur_frm.set_df_property("fieldname", "read_only", !doc.__islocal)

-Anand.



On Thu, Dec 5, 2013 at 1:21 PM, lxnow <la…@union.ph> wrote:

Hi, can someone help me how to set condition for an IF statement that checks if the status of a Customer Issue form (non-submittable form type) is *not* new? 

I am trying this:


    cur_frm.set_df_property(“field_name”, “read_only”, doc.name != null);

But it doesn’t see to work. Is doc.name not the right field to refer to the form ID? I’ve also tried doc.ID != null but that doesn’t work either.



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.

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.

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