Hi guys,
I have been trying to update the dimension values for my customers, But I am unable to do this because of some error in my code.
The error that I am getting is invalid baseenumtype.
I have tried to debug, but I can't able to find a solution to this problem.
I am getting an error on this line.
dimesiondefault = AxdDimensionUtil::getDimensionAttributeSetId(defdimensioncon);
static void dimensionreplacement_BK(Args _args)
{
CustTable custtable = CustTable::find("US-004");
Struct struct = new Struct();
container defdimensioncon;
DimensionDefault dimesiondefault;
DimensionAttributeSetItem dimattrsetitem;
DimensionAttribute dimattribute;
DimAttributeOMBusinessUnit ombussinessunit;
int i;
while select forUpdate Name,BackingEntityType from dimattribute
where dimattribute.BackingEntityType ==
tableNum(DimAttributeOMBusinessUnit)||
dimattribute.BackingEntityType ==
tableNum(DimAttributeOMDepartment)||
dimattribute.BackingEntityType ==
tableNum(DimAttributeHcmWorker)
&&
dimattribute.Type != DimensionAttributeType::DynamicAccount
join dimattrsetitem
where dimattrsetitem.DimensionAttribute == dimattribute.RecId
&&
dimattrsetitem.DimensionAttributeSet ==
DimensionCache::getDimensionAttributeSetForLedger()
{
if(dimattribute.BackingEntityType == tableNum(DimAttributeOMBusinessUnit))
{
struct.add(dimattribute.Name,'BU-002');
}
else if(dimattribute.BackingEntityType == tableNum(DimAttributeOMDepartment))
{
struct.add(dimattribute.Name,'DEP-002');
}
else if(dimattribute.BackingEntityType == tableNum(DimAttributeHcmWorker))
{
struct.add(dimattribute.Name,'114');
}
}
defdimensioncon += struct.fields();
for(i=1 ; i<= struct.fields();i++)
{
defdimensioncon += struct.fieldname(i);
defdimensioncon += struct.valueindex(i);
}
if(struct.fields())
{
dimesiondefault = AxdDimensionUtil::getDimensionAttributeSetId(defdimensioncon);
ttsBegin;
custtable.DefaultDimension = DimensionDefaultingService::serviceMergeDefaultDimensions(dimesiondefault,custtable.defaultdimension);
}
else
{
custtable.DefaultDimension = dimesiondefault;
}
custtable.doUpdate();
ttsCommit;
}
Please advise.
Regards,
AxTechie2120
*This post is locked for comments
I have the same question (0)