08-15-2024 08:33 AM - edited 08-15-2024 08:39 AM
I am developing a member formula which uses Percent Of Ownership in calculation.
I am using the following to get Percent of Ownership:
Dim pOwn As Decimal = api.Entity.PercentOwnership(entityID, parentID)
In the context of this calculation I have parentID but I only have a name for the entity. How can I get the Member ID from the Member Name?
Additional question: what will the code above return if there is NO parent/child relationship between parentID and entityID? "0"?
Thanks in advance.
Yan
Solved! Go to Solution.
08-15-2024 09:15 AM
Dim ForEntityID As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Entity.Id, ForEntity)
You will need to put the Entity name in the variable ForEntity.
08-15-2024 09:15 AM
Dim ForEntityID As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.Entity.Id, ForEntity)
You will need to put the Entity name in the variable ForEntity.
08-15-2024 09:22 AM
To get the memberId for your entityID use the following:
Dim memberID As Integer = BRApi.Finance.Members.GetMemberId(si, dimTypeId.Entity, memberName)
As for your last question I am not sure. My suggestion would be to just do some testing with different entityids and print the result.
08-15-2024 09:30 AM
Dim CoID As Integer = api.Members.GetMemberId(dimtype.Entity.Id,"CompanyName")
08-15-2024 07:12 PM
Hi Yan,
For future reference, you actually could have found this out quite quickly yourself through the snippets.
e.g.,
In regards to the other question, I vaguely remember that function actually returning 100 if there was no relationship but don't quote me on that.
Regards,
Daniel