Custom Query

91 views
Skip to first unread message

Rohit Waghchaure

unread,
Mar 7, 2013, 8:39:04 AM3/7/13
to erpnext-dev...@googlegroups.com
Hello Sir
                 I am trying to fetch data by using get_query. same query work for link field in parent table but i am getting error for child table field dc_number. I used following query
                             
cur_frm.fields_dict['dc_number'].get_query = function(doc) {
return "SELECT se.name FROM `tabStock Entry` se WHERE se.name_of_customer='Rohit'";
}

it give error  cur_frm.fields_dict.dc_number is undefined 

Thanking you

With Regards
Rohit

Anand Doshi

unread,
Mar 7, 2013, 8:49:00 AM3/7/13
to erpnext-dev...@googlegroups.com
Hi Rohit,

You will need to use:
cur_frm.fields_dict[child table's fieldname].grid.get_field("item_code").get_query = function(doc, cut, cdn) {
return your query
}

example of child table's fieldname:
in Sales Invoice, the Item table's field name is "entries". You can check the doctype record or customise form to search for the field name of the child table.

Thanks,
Anand.

--
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...@googlegroups.com.
To post to this group, send email to erpnext-dev...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/erpnext-developer-forum/-/H8PPcTXSMl4J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages