Automatically populating a Child Table

Hi,


We are pulling the other charge master from the customer master via a custom script. But I have noticed that the other charges field is populated but the child table remains empty.

Is it possible to get the value of the other charges and also automatically fill the child table.



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.

     

     
You'll have to modify the custom script.

In the callback of your function that gets the charge master, add this line after you set the value of charge:
cur_frm.script_manager.trigger("charge");

Thanks,
Anand.

On 24-Jul-2013, at 9:36 AM, Addy <ad...@rigpl.com> wrote:

Hi,

We are pulling the other charge master from the customer master via a custom script. But I have noticed that the other charges field is populated but the child table remains empty.

Is it possible to get the value of the other charges and also automatically fill the child table.



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 Anand,

Thanks for the info. I have checked the same and found one discrepancy. I have added the line of trigger code and when I made a SO and submitted the sales order I found that the taxes were not pulled but when I clear cached the SO it was automatically showing the other charges.


Kindly note that I made the SO after clearing the cache.


On Wed, Jul 24, 2013 at 11:15 AM, Anand Doshi <an...@iwebnotes.com> wrote:
You'll have to modify the custom script.

In the callback of your function that gets the charge master, add this line after you set the value of charge:
cur_frm.script_manager.trigger("charge");

Thanks,
Anand.

On 24-Jul-2013, at 9:36 AM, Addy <ad...@rigpl.com> wrote:


Hi,

We are pulling the other charge master from the customer master via a custom script. But I have noticed that the other charges field is populated but the child table remains empty.


Is it possible to get the value of the other charges and also automatically fill the child table.



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.

     

     
Btw, I just saw that the print preview is showing the taxes as populated but the actual document is not showing the child table as populated.


On Wed, Jul 24, 2013 at 1:40 PM, Aditya Duggal <ad...@rigpl.com> wrote:
Hi Anand,



Thanks for the info. I have checked the same and found one discrepancy. I have added the line of trigger code and when I made a SO and submitted the sales order I found that the taxes were not pulled but when I clear cached the SO it was automatically showing the other charges.


Kindly note that I made the SO after clearing the cache.


On Wed, Jul 24, 2013 at 11:15 AM, Anand Doshi <an...@iwebnotes.com> wrote:
You'll have to modify the custom script.

In the callback of your function that gets the charge master, add this line after you set the value of charge:
cur_frm.script_manager.trigger("charge");

Thanks,
Anand.

On 24-Jul-2013, at 9:36 AM, Addy <ad...@rigpl.com> wrote:


Hi,

We are pulling the other charge master from the customer master via a custom script. But I have noticed that the other charges field is populated but the child table remains empty.


Is it possible to get the value of the other charges and also automatically fill the child table.



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 Aditya,

Please check the console for any error messages. It should've worked. Some error could be preventing the table from refreshing.

-Anand.

On 24-Jul-2013, at 1:59 PM, Aditya Duggal <ad...@rigpl.com> wrote:

Btw, I just saw that the print preview is showing the taxes as populated but the actual document is not showing the child table as populated.


On Wed, Jul 24, 2013 at 1:40 PM, Aditya Duggal <ad...@rigpl.com> wrote:
Hi Anand,



Thanks for the info. I have checked the same and found one discrepancy. I have added the line of trigger code and when I made a SO and submitted the sales order I found that the taxes were not pulled but when I clear cached the SO it was automatically showing the other charges.


Kindly note that I made the SO after clearing the cache.


On Wed, Jul 24, 2013 at 11:15 AM, Anand Doshi <an...@iwebnotes.com> wrote:
You'll have to modify the custom script.

In the callback of your function that gets the charge master, add this line after you set the value of charge:
cur_frm.script_manager.trigger("charge");

Thanks,
Anand.

On 24-Jul-2013, at 9:36 AM, Addy <ad...@rigpl.com> wrote:


Hi,

We are pulling the other charge master from the customer master via a custom script. But I have noticed that the other charges field is populated but the child table remains empty.


Is it possible to get the value of the other charges and also automatically fill the child table.



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.

     

     
This is the console I am getting:

[15:02:42.508] Empty string passed to getElementById(). @ http://test.rigpl.com/lib/js/lib/jquery/jquery.min.js:3
[15:02:42.616] POST http://test.rigpl.com/server.py [HTTP/1.1 200 OK 462ms]

[15:02:43.172] 06521931133


This is the only thing I think might be making some issues.


One thing is for sure that the table is not populated even after submitting the document, in one of my accounts I have seen that the child table was populated after submitting only after I cleared the cache.


On Wed, Jul 24, 2013 at 2:39 PM, Anand Doshi <an...@iwebnotes.com> wrote:
Hi Aditya,

Please check the console for any error messages. It should've worked. Some error could be preventing the table from refreshing.


-Anand.

On 24-Jul-2013, at 1:59 PM, Aditya Duggal <ad…@rigpl.com> wrote:


Btw, I just saw that the print preview is showing the taxes as populated but the actual document is not showing the child table as populated.



On Wed, Jul 24, 2013 at 1:40 PM, Aditya Duggal <ad...@rigpl.com> wrote:
Hi Anand,



Thanks for the info. I have checked the same and found one discrepancy. I have added the line of trigger code and when I made a SO and submitted the sales order I found that the taxes were not pulled but when I clear cached the SO it was automatically showing the other charges.


Kindly note that I made the SO after clearing the cache.


On Wed, Jul 24, 2013 at 11:15 AM, Anand Doshi <an...@iwebnotes.com> wrote:
You'll have to modify the custom script.

In the callback of your function that gets the charge master, add this line after you set the value of charge:
cur_frm.script_manager.trigger("charge");

Thanks,
Anand.

On 24-Jul-2013, at 9:36 AM, Addy <ad...@rigpl.com> wrote:


Hi,

We are pulling the other charge master from the customer master via a custom script. But I have noticed that the other charges field is populated but the child table remains empty.


Is it possible to get the value of the other charges and also automatically fill the child table.



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.







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.