Forum Discussion
- MarkMatsonNew Contributor III
Hi,
I have used Complex expressions in the Data Source which should be able to do this, with something like:
If IWantParentText Then
Dim loadedEntity As Member = BRApi.Finance.Members.GetMember(si, dimType.entity, args.Value.toString)
Dim loadedEntityParent As list(Of Member) = BRApi.Finance.Members.GetParents(si, brapi.Finance.Dim.GetDimPk(si, "Entities"), loadedEntity.memberId, False)
' Return Text1
Return brapi.Finance.entity.Text(si, loadedEntityParent(0).memberId, 1)
Else
Return args.Value
End IfYou can also put the complex expression in a mask Transformation rule.
DM me if you can't get it going and I'll see if I can help.
- LeAnnTDangNew 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
- 11 months ago
- 11 months ago
- 11 months ago
- 10 months ago