How to get financial dimensions for Fixed assets with X++

Hello , I am trying to get financial dimension values for fixed assets with below code
but getting error as below

while select * from AssetTable
where AssetTable.AssetId== “DE-001”
join RecId from DimensionAttributeValueSet
where DimensionAttributeValueSet.RecId == AssetTable.DefaultDimension
join RecId, DisplayValue from DimensionAttributeValueSetItem
where DimensionAttributeValueSetItem.DimensionAttributeValueSet == DimensionAttributeValueSet.RecId
join RecId from DimensionAttributeValue
where DimensionAttributeValue.RecId == DimensionAttributeValueSetItem.DimensionAttributeValue
join RecId, Name from DimensionAttribute
where DimensionAttribute.RecId == DimensionAttributeValue.DimensionAttribute
info(DimensionAttribute.Name+"----"+ DimensionAttributeValueSetItem.DisplayValue);

Getting error as below at the where DimensionAttributeValueSet.RecId == AssetTable.DefaultDimension

The name ‘LedgerDefaultDimensionValueSet’ does not denote a class, a table, or an extended data type.

Please suggest if any reference to be added to model parameters
I have added sourcedocumentationtypes model as reference but still issue not resolved

Your code is very difficult to read, because you pasted it in a wrong way and line indentation got lost. This is how it should look like:

while select * from assetTable
	where assetTable.AssetId == "DE-001"
	join RecId from dimensionAttributeValueSet
		where dimensionAttributeValueSet.RecId == assetTable.DefaultDimension
	join RecId, DisplayValue from dimensionAttributeValueSetItem
		where dimensionAttributeValueSetItem.DimensionAttributeValueSet == dimensionAttributeValueSet.RecId
	join RecId from dimensionAttributeValue
		where dimensionAttributeValue.RecId == dimensionAttributeValueSetItem.DimensionAttributeValue
	join RecId, Name from dimensionAttribute
		where dimensionAttribute.RecId == dimensionAttributeValue.DimensionAttribute
	info(dimensionAttribute.Name+"----"+ dimensionAttributeValueSetItem.DisplayValue);

Use </> button to do that.

The error suggests that you model doesn’t have a reference to the model containing LedgerDefaultDimensionValueSet. If you find this object in Application Explorer, you’ll see that it’s defined in a model called SourceDocumentationTypes. Open Dynamics 365 > Model Management > Update model parameters to update references of your model.

Nevertheless I don’t recommend writing the query by yourself. You can utilize DimensionAttributeValueSetStorage class instead. For example:

DimensionAttributeValueSetStorage dimStorage = DimensionAttributeValueSetStorage::find(assetTable.DefaultDimension);

for (int i = 1; i <= dimStorage.elements(); i++)
	str attributeName = DimensionAttribute::find(dimStorage.getAttributeByIndex(i)).Name;
	str attributeValue = DimensionAttributeValue::find(dimStorage.getValueByIndex(i)).getValue();

	info(strFmt('%1: %2', attributeName, attributeValue));