Return query not working in child table's field trigger


Hi All,

  1. In stock entry item table (mtn_details), i have added trigger on s_warehouse and t_warehouse
  2. On s_warehouse trigger i have return query for t_warehouse.
  3. On t_warehouse trigger i have return query for s_warehouse.
Problem 
  1. All this work fine on previous version of erpnext, but did not work on responsive ui erpnext.
  2. Currently it show me all values of warehouse.
  3. So please provide me solution on this.
    For your reference i have pasted my code on http://pastebin.com/vuH2Qe4a

  Thanks and Regards
  Rohit



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.

     

     
Did you check your queries?

Also in the new version we are soon going to remove passing of direct queries as it is a security issue. Please use server-side methods to write queries.

thanks,
Rushabh


T: @rushabh_mehta

On 30-Jul-2013, at 6:48 PM, Rohit Waghchaure <ro...@indictranstech.com> wrote:


Hi All,
  1. In stock entry item table (mtn_details), i have added trigger on s_warehouse and t_warehouse
  2. On s_warehouse trigger i have return query for t_warehouse.
  3. On t_warehouse trigger i have return query for s_warehouse.
Problem 
  1. All this work fine on previous version of erpnext, but did not work on responsive ui erpnext.
  2. Currently it show me all values of warehouse.
  3. So please provide me solution on this.
    For your reference i have pasted my code on http://pastebin.com/vuH2Qe4a

  Thanks and Regards
  Rohit



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.

     

     
Hi Rohit,

Get query doesn't work like this.
It needs to be already defined before a field's trigger is called.

You should write such methods in cur_frm.cscript.custom_onload

For reference, see onload method of sales_common.js

Thanks,
Anand.

On 31-Jul-2013, at 10:14 AM, Rushabh Mehta <rm...@gmail.com> wrote:

Did you check your queries?

Also in the new version we are soon going to remove passing of direct queries as it is a security issue. Please use server-side methods to write queries.

thanks,
Rushabh


T: @rushabh_mehta

On 30-Jul-2013, at 6:48 PM, Rohit Waghchaure <ro...@indictranstech.com> wrote:


Hi All,
  1. In stock entry item table (mtn_details), i have added trigger on s_warehouse and t_warehouse
  2. On s_warehouse trigger i have return query for t_warehouse.
  3. On t_warehouse trigger i have return query for s_warehouse.
Problem 
  1. All this work fine on previous version of erpnext, but did not work on responsive ui erpnext.
  2. Currently it show me all values of warehouse.
  3. So please provide me solution on this.
    For your reference i have pasted my code on http://pastebin.com/vuH2Qe4a

  Thanks and Regards
  Rohit



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.

     

     



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 All,
Thanks for your suggestion, I have made changes in my code. I have remove this queries from trigger which is now work fine.

Thanks and Regards
Rohit


On Wed, Jul 31, 2013 at 11:52 AM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Rohit,

Get query doesn't work like this.
It needs to be already defined before a field's trigger is called.

You should write such methods in cur_frm.cscript.custom_onload

For reference, see onload method of sales_common.js

Thanks,
Anand.

On 31-Jul-2013, at 10:14 AM, Rushabh Mehta <rm...@gmail.com> wrote:

Did you check your queries?

Also in the new version we are soon going to remove passing of direct queries as it is a security issue. Please use server-side methods to write queries.

thanks,
Rushabh


T: @rushabh_mehta

On 30-Jul-2013, at 6:48 PM, Rohit Waghchaure <ro...@indictranstech.com> wrote:


Hi All,
  1. In stock entry item table (mtn_details), i have added trigger on s_warehouse and t_warehouse
  2. On s_warehouse trigger i have return query for t_warehouse.
  3. On t_warehouse trigger i have return query for s_warehouse.
Problem
  1. All this work fine on previous version of erpnext, but did not work on responsive ui erpnext.
  2. Currently it show me all values of warehouse.
  3. So please provide me solution on this.
For your reference i have pasted my code on http://pastebin.com/vuH2Qe4a

Thanks and Regards
Rohit



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.







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.