Create finacial dimenison Using X++

 //Change the arguments (variable) names and assign names as per your requirements

//Change in the function as well
public DimensionDefault createDefaultDimension(str department, str purpose, str costCenter)
{
    DimensionAttributeValueSetStorage   valueSetStorage = new DimensionAttributeValueSetStorage();
    DimensionDefault                    result;
    int                     i;
    DimensionAttribute      dimensionAttribute;
    DimensionAttributeValue dimensionAttributeValue;
    
    //Change the dimension names. Use the dimension name which are open and active in the system
    //I have given Region, Purpose and Costcentre just for an example
    
    container               conAttr = ["Region", "Purpose", "Costcentre"];
    
    //Change the values which you want to set in dimensions. Use values which are open and active in the system
    //I have given the arguments of function as values for dimensions.
    
    //Dimension name    ->      dimension value
    
    //Region            ->      department
    //Purpose           ->      purpose
    //Costcentre        ->      costCenter
    
    container               conValue = [department, purpose, costCenter];
    
    str                     dimValue;
    
    for (i = 1; i <= conLen(conAttr); i++)
    {
        dimensionAttribute = dimensionAttribute::findByName(conPeek(conAttr,i));
        if (dimensionAttribute.RecId == 0)
        {
            continue;
        }
        dimValue = conPeek(conValue,i);
        if (dimValue != "")
        {
            dimensionAttributeValue = dimensionAttributeValue::findByDimensionAttributeAndValue(dimensionAttribute,dimValue,false,true);
            valueSetStorage.addItem(dimensionAttributeValue);
        }
    }
    
    result = valueSetStorage.save();
    //It reutrns the value of type DimensionDefault
    return result;
}

CAR report in D365 f0


1.check metadata path

2.Navigate to specued path using cmd


C:\>cd K:

C:\>k:

 K:\>cd AosService\PackagesLocalDirectory

Note : Paste Xppbp cmd if mot found navigate to bin folder

K:\AosService\PackagesLocalDirectory>cd bin

K:\AosService\PackagesLocalDirectory\bin>xppbp.exe -metadata=K:\AosService\PackagesLocalDirectory -all -model="MV2" -xmlLog=C:\temp\BPCheckLogcd.xml -module="MV2" -car=c:\temp\CAReport.xlsx