shrink db log
ALTER DATABASE DYNAMICSXREFDB SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(DYNAMICSXREFDB_log, 1000)
ALTER DATABASE DYNAMICSXREFDB SET RECOVERY FULL WITH NO_WAIT
shrink db log
ALTER DATABASE DYNAMICSXREFDB SET RECOVERY SIMPLE WITH NO_WAIT
DBCC SHRINKFILE(DYNAMICSXREFDB_log, 1000)
ALTER DATABASE DYNAMICSXREFDB SET RECOVERY FULL WITH NO_WAIT
Create default dimensions in d365fo x++
public DimensionDefault createDefaultDimension(DimensionValue _CostC,
DimensionValue _department,
DimensionValue _branchCode )
{
DimensionAttributeValueSetStorage valueSetStorage = new DimensionAttributeValueSetStorage();
DimensionDefault ddim;
int i;
DimensionAttribute dimensionAttribute;
DimensionAttributeValue dimensionAttributeValue;
container conAttr = ['CostCenter','Department','BranchCode'];
container conValue = [_CostC, _department, _branchCode];
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);
}
}
ddim = valueSetStorage.save();
return ddim;
}