In the Db there are some very nice laid out tables such
as
erp.DynAttrValue
Which I thought would have all the Dynamic Attribute Values related to my Part Record and indeed that seems to be the case, however the RealtedToSysRowID field doesn’t match my Part SysRow ID, it maches an entry in another table called DynnAttrValueSet
select
[Part1].[PartNum] as [Part1_PartNum],
[Part1].[PartDescription] as [Part1_PartDescription],
[Part1].[ClassID] as [Part1_ClassID],
[Part1].[InActive] as [Part1_InActive],
[AttValuesbyPart].[DynAttrValue_AttrClassID] as [DynAttrValue_AttrClassID],
[AttValuesbyPart].[Calculated_Color] as [Calculated_Color],
[AttValuesbyPart].[Calculated_FormFactor] as [Calculated_FormFactor],
[AttValuesbyPart].[Calculated_Material] as [Calculated_Material],
[AttValuesbyPart].[Calculated_PSU] as [Calculated_PSU]
from Erp.Part as Part1
left outer join (select
[Part].[PartNum] as [Part_PartNum],
[DynAttrValue].[AttrClassID] as [DynAttrValue_AttrClassID],
(MAX(
IIF(DynAttrValue.AttributeID = 'Color', DynAttrClassDtlListVal.Description, ''))) as [Calculated_Color],
(MAX(IIF(DynAttrValue.AttributeID = 'FormFactor', DynAttrClassDtlListVal.Description, ''))) as [Calculated_FormFactor],
(MAX(IIF(DynAttrValue.AttributeID = 'Material', DynAttrClassDtlListVal.Description, ''))) as [Calculated_Material],
(MAX(CAST(IIF(DynAttrValue.AttributeID = 'PSU', DynAttrValue.DataLogical, '') as int))) as [Calculated_PSU]
from Erp.DynAttrValue as DynAttrValue
left outer join Erp.DynAttrClassDtlListVal as DynAttrClassDtlListVal on
DynAttrClassDtlListVal.Code = DynAttrValue.DataCharacter
and DynAttrClassDtlListVal.AttrClassID = DynAttrValue.AttrClassID
and DynAttrClassDtlListVal.AttributeID = DynAttrValue.AttributeID
inner join Erp.Part as Part on
DynAttrValue.RelatedToSysRowID = Part.SysRowID
and ( Part.ClassID = 'ENC' )
group by [Part].[PartNum],
[DynAttrValue].[AttrClassID]) as AttValuesbyPart on
Part1.PartNum = AttValuesbyPart.Part_PartNum
where (Part1.ClassID = 'ENC' and Part1.InActive = 0)
select
*
from Erp.DynAttrValue as DynAttrValue
left outer join Erp.DynAttrClassDtlListVal as DynAttrClassDtlListVal on
DynAttrClassDtlListVal.Code = DynAttrValue.DataCharacter
and DynAttrClassDtlListVal.AttrClassID = DynAttrValue.AttrClassID
and DynAttrClassDtlListVal.AttributeID = DynAttrValue.AttributeID
inner join Erp.Part as Part on
DynAttrValue.RelatedToSysRowID = Part.SysRowID
Part has a field called DefaultAttributeSetID. You would join that to the DynAttrValueSet table, AttributeSetID field.
From what I have seen, RelatedToSysRowID is always related to the Dynamic Attribute Set, and then the Dynamic Attribute Set ID is related to the Business Entities. Part, JobMtl, etc.
Yeah I think they changed something Major in 202X cause we have a bunch of “extra” tables in the middle and I ca’nt seem to figure out how to connect them.