Hello All,
I'm looking for some help with a change notification that combines Vendor Style (item repo) with Vendor SKU (SKU repo) to create a new Vendor Item Name (SKU repo). If the Vendor Style in Item repo is changed, then it needs to trigger and update the Vendor Item Name on all of the SKU records for that item. But if the Vendor SKU in the SKU repo is changed, it only needs to update the Vendor Item Name for that one particular SKU.
I'm new to change notifications, but if I understand it right I need one cn registry that triggers on Vendor Style in Item with a transformation that will update Vendor Item Name for all SKUs. And I need a cn registry that triggers on Vendor SKU with a transformation that will update just that one SKU.
So far I have the CN registry and transformation at the SKU level working. If the Vendor SKU is changed, it will update the Vendor Item Name for just that SKU with the new correct Vendor Item Name value of Vendor Style + Vendor SKU.
What I can't figure out is the one to many change to update all of the SKUs when Vendor Style at the Item level is changed. Right now it's updating all of the SKUs with the same data. It's pulling in the correct Vendor Style from Item, but then where it should add the different Vendor SKU for each SKU, it's just using the first Vendor SKU for all. I guess it's pulling the target value for just the first row and then applying that to all rows for that item.
For my CN Registry I have it triggering in my Item_Staging repo and the attribute as Vendor Style.
Here is what I have set up for the transformation rule since I'm assuming that's where I'm going wrong.
CN_Target_Repo
SKU_Staging
CN_Target_Attribute_Name
Vendor Item Name
CN_Target_SQL
SELECT InternalRecordId
FROM SKU_Staging
WHERE Item_Number = ||Item Number||
CN_Target_Value_Source_SQL
SELECT
LEFT(LTRIM(RTRIM(CONCAT(ISNULL(i.Vendor_Style,''), ' ', ISNULL(s.Vendor_SKU,'')))), 20)
AS Vendor_Item_Name
FROM
Item_Staging i
INNER JOIN
SKU_Staging s ON i.item_number = s.item_number
WHERE
s.Item_Number = ||Item Number||
CN_Target_Value_Source_Restricted_Name
Vendor_Item_Name
CN_Condition_Repo
SKU_Staging
CN_Condition_SQL
SELECT
ISNULL(Vendor_Item_Name,'') AS Vendor_Item_Name
FROM
SKU_Staging
WHERE
Item_Number = ||Item Number||
CN_Condtion_Attribute_Restricted_Name
Vendor_Item_Name
CN_Condition_Operator
<>
CN_Condtion_Data_Type
Text
CN_Condition_Value_SQL
SELECT
LEFT(LTRIM(RTRIM(CONCAT(ISNULL(i.Vendor_Style,''), ' ', ISNULL(s.Vendor_SKU,'')))), 20)
AS Vendor_Item_Name
FROM
Item_Staging i
INNER JOIN
SKU_Staging s ON i.item_number = s.item_number
WHERE
s.Item_Number = ||Item Number||
CN_Condition_Value_Retricted_Name
Vendor_Item_Name
Thanks!
------------------------------
Ryan Hayes
Sundance Catalog Co
UT
------------------------------