Matrix and Subdescriptions

We use our Subdescription 1, 2, and 3 fields to list our Matrix dimension (i.e. Style, Color, and Size).

This works fine when we create a new Matrix by using the new Item matrix wizard, but when we update or change attributes from within the matrix item screen it doesn't update the Subdescription fields.

So my questions is how should I handle this?

  1. Create SQL triggers or
  2. Run an update query every so often to copy the matrix dimensions into the SubDescription 1, 2, and 3 fields?

Or is there an other way to handle this?

Even if I use option 1, I would still need to perform option 2 just to get everything up to date.

Can anybody (Glen Adams or AA) provide me with the update query and/or the SQL triggers to accomplish this?

Thank you!

Reply to
Alex
Loading thread data ...

This query will update subdesc 1-3 with the matrix detail (Cotton, Blue, XL)

update item set subdescription1 = b.detail1, subdescription2 = b.detail2, subdescription3 = b.detail3 from item a, itemclasscomponent b where a.id = b.itemid

This trigger will update subdesc 1-3 on any new items added to the matrix:

CREATE TRIGGER [MatrixUpdate] ON [dbo].[ItemClassComponent] FOR INSERT, UPDATE AS update item set subdescription1 = b.detail1, subdescription2 = b.detail2, subdescription3 = b.detail3 from item a, itemclasscomponent b where a.id = b.itemid and b.lastupdated > getdate() - .02

************ USE AT OWN RISK

Casey Hanson New West Technologies

----------------- Check out amazing RMS Enhancements:

formatting link

Reply to
CaseyHanson

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.