Forum Discussion
Thanks Mark. I modified the rule a bit and was able to use it. Thank you very much for the sample script.
Dim SourceEntity As String = Args.GetSource("E#")
Dim TargetEntity As String = ""
If SourceEntity.Length = 9 Then
TargetEntity = "HC" & SourceEntity.Substring(0,5)
Else
TargetEntity = SourceEntity
End If
If TargetEntity.StartsWith("HC17") Then
Dim loadedEntity As Member = BRApi.Finance.Members.GetMember(si, dimTypeID.Entity, BRApi.Finance.Members.GetMemberId(si,dimtypeID.Entity, TargetEntity))
Dim loadedEntityParent As list(Of Member) = BRApi.Finance.Members.GetParents(si, BRApi.Finance.Dim.GetDimPk(si, "JFS_Entities"), loadedEntity.memberId, False)
For Each mParent As Member In loadedEntityParent
If BRApi.Finance.Members.IsDescendant(si, BRApi.Finance.Dim.GetDimPk(si, "JFS_Entities"), BrApi.Finance.Members.GetMemberId(si,dimTypeID.Entity,"ActiveLifestyle"), mParent.MemberId) Then
Return BRApi.Finance.Entity.Text(si, mParent.MemberID, 8, -1, -1)
End If
Next
Else
Return TargetEntity
End If
Related Content
- 11 months ago
- 11 months ago
- 11 months ago
- 10 months ago