Dynamic Part Attribute Values

Proof:

Indeed one sets the Part Default AttributeSet by updating fields AttrClassID and DefaultAttributeSetID in the Part Master DMT like so:

Company,PartNum,AttrClassID,DualUOMClassID,TrackInventoryAttributes,DefaultAttributeSetID
XXXXXX,PL0010750,PL-075-SS-LB,,TRUE,132

This assumes the AttributeSetID (132) has been previously created.

If you have AUOM, you can DMT the AttributeSets llike so:

Company,AttributeSetID,ShortDescription,AttrClassID,TemplateWhereAvailable,DynAttrValue#WID,DynAttrValue#LEN,DynAttrValue#THK,DynAttrValue#MTL,DynAttrValue#STD,Template
XXXXXX,0,"3/4x48x096 304SS",PL-075-SS-LB,,48,96,0.75,001,48x096,0

If you don’t have AUOM, then you can create all the variants manually or use the REST API like so:

REQUEST:

curl -X 'POST' \
  'https://<your server>/api/v1/Erp.BO.DynAttrValueSetSvc/UpdateDynAttrValueSetDataSet' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -H 'X-API-Key: XXXX' \
  -H 'Authorization: Bearer blah blah blah' \
  -d '{
  "ds": {      "InventoryDynAttrValues": [
        {
          "WID": 48,
          "LEN": 96,
          "STD": "48x096",
          "THK": 0.75,
          "MTL": "001",
          "WEIGHT": 0,
          "InventoryAttributeColumnTemplateWhereAvailable": "",
          "InventoryAttributeColumnActive": true,
          "InventoryAttributeColumnHasBeenUsed": false,
          "InventoryAttributeColumnShortDescription": "3/4x48x096 304SS",
          "InventoryAttributeColumnDescription": "3/4x48x096 304SS",
          "InventoryAttributeColumnCompany": "XXXXXX",
          "InventoryAttributeColumnAttrClassID": "PL-075-SS-LB",
          "InventoryAttributeColumnAttributeSetID": 0,
          "RowMod": "A",
          "SysRevID": 0,
          "SysRowID": "00000000-0000-0000-0000-000000000000"
        }
      ],}
}'

This request returns the unique AttributeSetID in the response (notice ID: 132) which can be used in your Part DMT to update the Part Default AttributeSet.

RESPONSE:

{
  "parameters": {
    "ds": {
      "InventoryDynAttrValues": [
        {
          "WID": 48,
          "LEN": 96,
          "STD": "48x096",
          "THK": 0.75,
          "MTL": "001",
          "WEIGHT": 992.2176,
          "InventoryAttributeColumnTemplateWhereAvailable": "0",
          "InventoryAttributeColumnActive": true,
          "InventoryAttributeColumnHasBeenUsed": false,
          "InventoryAttributeColumnShortDescription": "3/4x48x096 304SS",
          "InventoryAttributeColumnDescription": "3/4x48x096 304SS",
          "InventoryAttributeColumnCompany": "xxxxxx",
          "InventoryAttributeColumnAttrClassID": "PL-075-SS-LB",
          "InventoryAttributeColumnAttributeSetID": 132,
          "RowMod": "",
          "SysRevID": 114028201,
          "SysRowID": "f5a8ff95-3c98-4b48-952a-8a29aa2aa76b"
        }
      ]
    }
  }
}

PS - I did not test the API in an a non-AUOM environment, but 99% sure it’s the same.

Hope this helps.
Josh

1 Like