refRecId getLedgerDimension(container _c)
{
DimensionServiceProvider DimensionServiceProvider = new DimensionServiceProvider();
LedgerAccountContract LedgerAccountContract = new LedgerAccountContract();
DimensionAttributeValueContract ValueContract;
List ListValueContract = new List(Types::Class);
dimensionAttributeValueCombination dimensionAttributeValueCombination;
DimensionStorage dimStorage;
str _ledgerAccount = conPeek(_c, #Account);
str _department = conPeek(_c, #Department);
str _location = conPeek(_c, #Location);
str _region = conPeek(_c, #Region);
str _zone = conPeek(_c, #Zone);
str _company = conPeek(_c, #Company);
if (_department)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Department') ;
ValueContract.parmValue(_department);
ListValueContract.addEnd(ValueContract);
}
if (_location)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Location') ;
ValueContract.parmValue(_location);
ListValueContract.addEnd(ValueContract);
}
if (_region)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Region') ;
ValueContract.parmValue(_region);
ListValueContract.addEnd(ValueContract);
}
if (_zone)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Zone') ;
ValueContract.parmValue(_zone);
ListValueContract.addEnd(ValueContract);
}
if (_company)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Company') ;
ValueContract.parmValue(_company);
ListValueContract.addEnd(ValueContract);
}
LedgerAccountContract.parmMainAccount(_ledgerAccount);
LedgerAccountContract.parmValues(ListValueContract);
dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(LedgerAccountContract);
dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(dimStorage.save());
return dimensionAttributeValueCombination.RecId;
}
{
DimensionServiceProvider DimensionServiceProvider = new DimensionServiceProvider();
LedgerAccountContract LedgerAccountContract = new LedgerAccountContract();
DimensionAttributeValueContract ValueContract;
List ListValueContract = new List(Types::Class);
dimensionAttributeValueCombination dimensionAttributeValueCombination;
DimensionStorage dimStorage;
str _ledgerAccount = conPeek(_c, #Account);
str _department = conPeek(_c, #Department);
str _location = conPeek(_c, #Location);
str _region = conPeek(_c, #Region);
str _zone = conPeek(_c, #Zone);
str _company = conPeek(_c, #Company);
if (_department)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Department') ;
ValueContract.parmValue(_department);
ListValueContract.addEnd(ValueContract);
}
if (_location)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Location') ;
ValueContract.parmValue(_location);
ListValueContract.addEnd(ValueContract);
}
if (_region)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Region') ;
ValueContract.parmValue(_region);
ListValueContract.addEnd(ValueContract);
}
if (_zone)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Zone') ;
ValueContract.parmValue(_zone);
ListValueContract.addEnd(ValueContract);
}
if (_company)
{
ValueContract = new DimensionAttributeValueContract();
ValueContract.parmName('Company') ;
ValueContract.parmValue(_company);
ListValueContract.addEnd(ValueContract);
}
LedgerAccountContract.parmMainAccount(_ledgerAccount);
LedgerAccountContract.parmValues(ListValueContract);
dimStorage = DimensionServiceProvider::buildDimensionStorageForLedgerAccount(LedgerAccountContract);
dimensionAttributeValueCombination = DimensionAttributeValueCombination::find(dimStorage.save());
return dimensionAttributeValueCombination.RecId;
}
No comments:
Post a Comment