Forum Discussion
LeAnnTDang
3 years agoNew Contributor III
How to setup transformation rule to look at parent text value in entity dimension?
For Entity transformation rule, we want to build logic so that Source entity looks at its parent entity in one of our entity hierarchy in OS dimension, read and then map to the parent entity text8 as...
LeAnnTDang
3 years agoNew Contributor III
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
- 3 years ago
- 3 years ago