Fetching a filtered list of Purchase Orders

I'm trying to get a filtered list of purchase orders to show up in a custom field called pull_out_reference in sales order document.  This is the script I'm trying to get to work

cur_frm.fields_dict['pull_out_reference'].get_query = function(doc, cdt, cdn) {
return 'SELECT name FROM `tabPurchase Order` WHERE swapping == 1 AND docstatus == 1 AND naming_series LIKE "Z%" ASC LIMIT 10';
}

  • swapping is a check-type (Binary) custom field in Purchase Order, and I want to only show those that were checked
  • I want to show only submitted forms
  • and I only want to show Purchase Orders that begin with naming series Z (e.g. Z01234)
The sales order form loads fine. Just not sure what is missing.



You received this message because you are subscribed to the Google Groups "ERPNext User's Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un...@googlegroups.com.

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


It should be swapping=1 instead of swapping==1, same for docstatus

On 27-Jan-2014, at 2:05 PM, lxnow wrote:

I'm trying to get a filtered list of purchase orders to show up in a custom field called pull_out_reference in sales order document.  This is the script I'm trying to get to work

cur_frm.fields_dict['pull_out_reference'].get_query = function(doc, cdt, cdn) {
return 'SELECT name FROM `tabPurchase Order` WHERE swapping == 1 AND docstatus == 1 AND naming_series LIKE "Z%" ASC LIMIT 10';
}

  • swapping is a check-type (Binary) custom field in Purchase Order, and I want to only show those that were checked
  • I want to show only submitted forms
  • and I only want to show Purchase Orders that begin with naming series Z (e.g. Z01234)
The sales order form loads fine. Just not sure what is missing.



You received this message because you are subscribed to the Google Groups “ERPNext User’s Forum” group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un…@googlegroups.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 User's Forum" group.

To unsubscribe from this group and stop receiving emails from it, send an email to erpnext-user-forum+un...@googlegroups.com.

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