//find account structures for particular main account static void findAccountStructuresByMainAccount(Args _args) { DimensionHierarchy hierarchy; DimensionHierarchyLevel hierarchyLevel; DimensionHierarchyId hId; int i = 1; // Set to 0 if you also want to get the root MainAccount level //缺陷(只能查找一个,无法查询所有) hId = DimensionHierarchy::getAccountStructure(MainAccount::findByMainAccountId("6602.34").RecId); do { i++; hierarchyLevel = DimensionHierarchyLevel::findByDimensionHierarchyAndLevel(hId, i); //add DimensionConstraintNode isOptional if (hierarchyLevel) { info(strFmt("%1,%2",DimensionAttribute::find(hierarchyLevel.DimensionAttribute).Name,DimensionConstraintNode::findByHierarchyLever(hierarchyLevel.RecId).IsOptional)); } } while (hierarchyLevel); } /* public static DimensionConstraintNode findByHierarchyLever(RecId _recId) { DimensionConstraintNode dimensionConstraintNode; select firstonly dimensionConstraintNode where dimensionConstraintNode.DimensionHierarchyLevel == _recId; return dimensionConstraintNode; } */
留言评论
暂无留言