📣 We're Hiring!

Sqs search with custom field in where

Hi,
i’m tryng to change sqs in line_items to add where condition for cutsom field present in aos_products_cstm

sqs_objects["product_name[" + prodln + "]"] = {
    "form": "EditView",
    "method": "query",
    "modules": ["AOS_Products"],
    "group": "or",
    "field_list": ["name", "id", "part_number", "cost", "price", "description", "currency_id", "promo_c", "max_disc_amt_c", "max_disc_unit_c", "aos_product_category_name"],
    "populate_list": ["product_name[" + prodln + "]", "product_product_id[" + prodln + "]", "product_part_number[" + prodln + "]", "product_product_cost_price[" + prodln + "]", "product_product_list_price[" + prodln + "]", "product_item_description[" + prodln + "]", "product_currency[" + prodln + "]", "product_promo_c[" + prodln + "]", "product_max_disc_amt_c[" + prodln + "]", "product_max_disc_unit_c[" + prodln + "]"],
    "required_list": ["product_id[" + prodln + "]"],
    "conditions": [{
      "name": "name",
      "op": "like_custom",
      "end": "%",
      "value": ""
    }],
    "order": "name",
    "limit": "30",
    "post_onblur_function": "formatListPrice(" + prodln + ");",
    "no_match_text": "No Match"
  };

Adding custom WHERE clause like below:

 "conditions": [{
      "name": "promo_c",
      "op": "like_custom",
      "end": "%",
      "value": "1"
    }],

thrown a an error in mysql cause it prepends aos_products table instead aos_products_cstm

see below:

MySQL error 1054: Unknown column ‘aos_products.promo_c’ in ‘where clause’

If i prepend table name like this:

 "conditions": [{
      "name": "aos_products_cstm.promo_c",
      "op": "like_custom",
      "end": "%",
      "value": "1"
    }],

It still prepend aos_products table:
MySQL error 1054: Unknown column ‘aos_products.aos_products_cstm.promo_c’ in ‘where clause’

Is there any way to achieve this?

Many thanks to all for any hint!

Hey there,

Are you still having issues with this, by chance?


I haven’t worked with the SQS functionality at all, so I’m not entirely sure what to suggest, I’m afraid.

However, I have found a Thread wherein the user had issues around SQS and Custom Fields:

Perhaps something in this would shed light on what is needed?


Otherwise, where did you add the new condition segment?

Was it as its own new sqs_objects[] section?
Or part of the “product_name”'s “Conditions” section?

It might help myself, or some other user, with digging into this issue

Thanks!