Unable to populate Letter Head field in the Sales Order Automatically.

53 views
Skip to first unread message

Aditya Duggal

unread,
Aug 30, 2012, 3:02:36 PM8/30/12
to erpnext-dev...@googlegroups.com
Hi All,

I have been facing a problem with some code, I am trying to pull the letter head field from Sales Tax Charge Master doctype into the Sales Order. The code in the custom script is 

cur_frm.add_fetch('sales_taxes_and_charges_master','letter_head','letter_head');

But it seems that when I load the customer, there is a script which pulls the Sales Tax Charges with the custom script 

cur_frm.add_fetch('customer','state_tax_type','charge');

But with the script of sales tax master I am unable to pull the letter head field which is also present in the Sales Tax master with the help of the custom fields.

Please let me know how can I link the letter head field in a Sales Order to the letter head field in sales tax master.

Nabin Hait

unread,
Aug 31, 2012, 1:04:23 AM8/31/12
to erpnext-dev...@googlegroups.com
Hi Aditya,

You have entered incorrect field name "sales_taxes_and_charges_master" instead of "charge". The code will be:

cur_frm.add_fetch('charge','letter_head','letter_head');

Now it will fetch letter head on selecting sales tax master.

But it will not fetch letter_head on selection of customer, as cascading trigger call is not possible with add_fetch function.
You can use one workaround for this, put letter_head field in customer master and pull the value from there.
Also you can write an add_fetch for customer master, that when you select sales_tax_type in customer master, it will pull letter_head from sales tax master.

Regards,
Nabin Hait

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/RfXnx-1gC0MJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Regards,
Nabin Hait

Aditya Duggal

unread,
Aug 31, 2012, 2:11:29 AM8/31/12
to erpnext-dev...@googlegroups.com
Hi Nabin,

Thanks for the correction, the work around works well. But my question is that if I want to ensure that all users click on the "Get Taxes and Charges" button then how can I do that?

Since I was thinking that fetching the letter head from charge would ensure that people click on that button. Is there a way to make sure that people click on that charge button and also if I wanted to link the C-Form field in invoice to the charges (which is actually the case) then how could I do that if the cascading trigger is not possible and my charge is loaded with the DN itself.

Please let me know the same.


On Friday, August 31, 2012 10:34:24 AM UTC+5:30, Nabin Hait wrote:
Hi Aditya,

You have entered incorrect field name "sales_taxes_and_charges_master" instead of "charge". The code will be:

cur_frm.add_fetch('charge','letter_head','letter_head');

Now it will fetch letter head on selecting sales tax master.

But it will not fetch letter_head on selection of customer, as cascading trigger call is not possible with add_fetch function.
You can use one workaround for this, put letter_head field in customer master and pull the value from there.
Also you can write an add_fetch for customer master, that when you select sales_tax_type in customer master, it will pull letter_head from sales tax master.

Regards,
Nabin Hait

On Fri, Aug 31, 2012 at 12:32 AM, Aditya Duggal <aditya...@gmail.com> wrote:
Hi All,

I have been facing a problem with some code, I am trying to pull the letter head field from Sales Tax Charge Master doctype into the Sales Order. The code in the custom script is 

cur_frm.add_fetch('sales_taxes_and_charges_master','letter_head','letter_head');

But it seems that when I load the customer, there is a script which pulls the Sales Tax Charges with the custom script 

cur_frm.add_fetch('customer','state_tax_type','charge');

But with the script of sales tax master I am unable to pull the letter head field which is also present in the Sales Tax master with the help of the custom fields.

Please let me know how can I link the letter head field in a Sales Order to the letter head field in sales tax master.

--
You received this message because you are subscribed to the Google Groups "ERPNext Developer Forum" group.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To unsubscribe from this group, send email to erpnext-developer-forum+unsub...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/RfXnx-1gC0MJ.
For more options, visit https://groups.google.com/groups/opt_out.
 
 



--
Regards,
Nabin Hait

Reply all
Reply to author
Forward
0 new messages