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!