Unable to set value in item table

Hello all,

             I have added custom field in item table (Item Volume). I have to fetch this value when i select item in sales order only from client side. For that i have written wn.call method in on load function of sales order and successfully retrieved. I have added one more custom field in sales order details (Test Volume). I have to set the fetched value from wn.call method to test_volume. For that i have used following code on load function
var d=locals[cdt][cdn]
d.test_volume=(Fetched value using wn.call method)

I did not get any kind of error, but fetched value also not set to the custom field (Test Volume).
So my question is
1 Can i use var d=local[cdt][cdn] on load of sales order or it work only field trigger (like cur_frm.cscript.test_volume).

Thanks And Regards
Rohit



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 post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ea3ee4de-dd61-40b1-ae55-93a5a55e7de0%40googlegroups.com.

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

 

 

You have to loop in sales order item table and call that function for each item to retrieve volume. Then you should set return value in test volume field of that row.

But this will only solve the purpose when sales order will be loaded through mapper.

But for new item directly added, you should write add_fetch function.

On 4 Jul 2013 20:45, "Rohit Waghchaure" <ro...@indictranstech.com> wrote:
Hello all,

I have added custom field in item table (Item Volume). I have to fetch this value when i select item in sales order only from client side. For that i have written wn.call method in on load function of sales order and successfully retrieved. I have added one more custom field in sales order details (Test Volume). I have to set the fetched value from wn.call method to test_volume. For that i have used following code on load function
var d=locals[cdt][cdn]
d.test_volume=(Fetched value using wn.call method)

I did not get any kind of error, but fetched value also not set to the custom field (Test Volume).
So my question is
1 Can i use var d=local[cdt][cdn] on load of sales order or it work only field trigger (like cur_frm.cscript.test_volume).

Thanks And Regards
Rohit



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 post to this group, send email to er…@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/ea3ee4de-dd61-40b1-ae55-93a5a55e7de0%40googlegroups.com.

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






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 post to this group, send email to er...@googlegroups.com.

To view this discussion on the web visit https://groups.google.com/d/msgid/erpnext-developer-forum/CA%2BCj7tjZWVyGvS6HtkrdnjTB%3DyTaYdLpFYDXQ%3D9tFgpmBVOX7Q%40mail.gmail.com.

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