Part - Dynamic Attributes BAQ

I am trying to create a BAQ for use in a Quick Search for Part Lookups based on their Dynamic Attribute values and cannot figure out the table relationship between Part and DynAttrValue.

Does anyone have a working BAQ they could share for 2025?

***We are not using this for Advanced UOM.

Thank you in advance.

I don’t have one handy but did this the other day. I’ll be back.

The Part Master has a field DefaultAttributeSetID which maps to DynAttrValueSet.AttributeSetID

This is the default Attribute Set for a part when you add it to an Order, Job, PO, etc. Not necessarily the Attribute Set on Part Transactions as the user can change them from default.

In most, if not all of the transaction tables, the field is AttributeSetID which also maps to DynAttrValueSet.AttributeSetID

PS - a DynAttrValueSet is a unique combination of values for all Attributes (DynAttrClassDtl) in a DynAttrClass. One thing I’d like to know is how to unpack the values of a set from the AttributeSetHashAllValues field. hint hint: @klincecum

And for those in the back row, the whole thing is:

Part

  • Part.DefaultAttributeSetID → DynAttrValueSet.AttributeSetID

DynAttrValueSet

  • DynAttrValueSet.SysRowID → DynAttrValue.RelatedToSysRowID

DynAttrValue

I’m assuming that is just a “check” and that data has been lost.

Yeah probably for uniqness and sorting but cannot unpack a hashed field AFAIK.

But you can compare to an newly hashed like:


SELECT *
FROM DynAttrValueSet
WHERE AttributeSetHashAllValues <> 
    CONVERT(VARCHAR(64), HASHBYTES('SHA2_256', 
        CONCAT(Value1,Value2,Value3)
    ), 2);

assuming you know the algo, ‘what’, and order that they are hashed.

Not enough sugar for a dime.

Video Games GIF by South Park

Thanks for sharing this. I hadn’t discovered the DynAttrValue relationship yet.
BTW, on mine (2025.1.x) it’s:

DynAttrValueSet.SysRowID = DynAttrValue.RelatedToSysRowID

Mine too, I made a boo boo.