raghav
01/19/2024, 7:40 AMraghav
01/19/2024, 7:59 AMSELECT
p.id as promo_id,
p.customers as customer_list,
c.id as group_customer_id
FROM
promotionCode AS p
LEFT OUTER JOIN EntityGroup AS eg ON p.customergroup = eg.id
LEFT OUTER JOIN EntityGroupMember AS egm ON eg.id = egm.group
LEFT OUTER JOIN customer AS c on egm.member = c.id
WHERE
p.isinactive = 'F'
AND p.isPublic = 'F'
AND p.custrecord_promotion_do_not_sync = 'F'
AND p.name NOT LIKE '%PROJECT%'
AND p.name NOT LIKE '%project%'
AND (
(
egm.member is NOT NULL
AND c.isinactive = 'F'
)
OR egm.member is NULL
)
Shai Coleman
01/19/2024, 10:27 AMraghav
01/19/2024, 2:16 PMraghav
01/23/2024, 1:10 AMSELECT
p.id as promo_id,
p.customers as customer_list,
FROM
promotioncode AS p
JOIN map_promotioncode_customers AS MAP on MAP.mapone = p.id
JOIN customer AS cust on MAP.maptwo = cust.id
WHERE
p.id = '181'
Getting Error : Invalid search type: map_promotioncode_customers
Also tried promotionCodeEntityMap but seems its also incorrect or not available in SuiteQL not really sure on it.Shai Coleman
01/23/2024, 10:31 AMpromotioncodeentitymap
isn't available via SuiteQL
You can try the BUILTIN.MNFILTER
way.
I don't know much about multi select fields, as I didn't have the need to deal with them yet.