User can add values manually to Custom dimension attribute type only. For all other backing entities it should go via standard table creation, say, new CustTable record, etc.
The easiest way to create a new Custom list dimension value is to use the standard service DimensionValueService as follows. Say, you need to create a new value by using _newProjCategory record fields.
DimensionValueService dimensionValueService = new DimensionValueService(); DimensionValueContract dimensionValueContract = new DimensionValueContract(); dimensionValueContract.parmValue(_newProjCategory.Id); dimensionValueContract.parmDimensionAttribute(myDimHelper::getProjCategoryAttribute); dimensionValueContract.parmDescription(_newProjCategory.Name); dimensionValueService.createDimensionValue(dimensionValueContract);
It creates the display value as its description.
No comments:
Post a Comment