Custom Query

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



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/msg/erpnext-developer-forum/-/H8PPcTXSMl4J.

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

 

 

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.

On 07-Mar-2013, at 7:09 PM, Rohit Waghchaure <ro...@indictranstech.com> wrote:

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



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/msg/erpnext-developer-forum/-/H8PPcTXSMl4J.

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.

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

 

 

1 Like