09-05-2024 01:33 AM
I am trying to get dimension info using a member name. I came across the function, Dim nValue As Integer = BRApi.Finance.Members.GetDimIdFromMemberId(si, dimTypeId, memberId), but it requires dimTypeId. Is it possible to get dimTypeId using member name
Solved! Go to Solution.
09-05-2024 05:56 AM
There may be ways in your code to make this dynamic, but just with the (metadata) member name alone, it will not be possible. As the same name may exist in different dimension types, the system would not know which one the rule is referring to.
09-05-2024 03:01 AM
Hi, no, I do not think it is possible to get DimTypeId from a member name. That is because member names may be the same between different dimensions, e.g. None exists in every account-type dimension. With just the name, the system would not be able to know which dimension to return.
Is it not working for you to provide the DimTypeId like this in the formula (using account as an example)?
DimTypeId.Account
09-05-2024 03:11 AM
Hi, "DimTypeId.Account" does work but we thought of keeping it as dynamic.
09-05-2024 05:56 AM
There may be ways in your code to make this dynamic, but just with the (metadata) member name alone, it will not be possible. As the same name may exist in different dimension types, the system would not know which one the rule is referring to.
09-05-2024 06:09 AM
Got it, Thank You!!
a month ago
You could cycle through each of the DimType's looking for the member name. In many instances, that would narrow it down to a single DimType. Worst case, you could at least prompt the user for a list of DimType's the member is actually in. At the end of the day though, you are attempting to buck how OS is designed. Member names have to be unique within a DimType, but it is perfectly acceptable to reuse member names across DimType's (eg None, Root, Top, Unassigned)
a month ago
Thank You!!