Forum Discussion

Sam_OS's avatar
Sam_OS
New Contributor
6 months ago

Transformation Rules using Entity Text Field

Hi I have two source accounts bringing in same amounts for multiple Entities. Some of the entities are local and some overseas. The only unique identifier is Text7 field in the entities. How can I map the source accounts to OS accounts using Entity Text Field 7. Below is the example

Acc 1000 - $7000 E#AUS

Acc 2000 - $7000 E#AUS

Acc 1000 - $9000 E#NZ

Acc 2000 - $9000 E#NZ

In the above example Amount $7000 belongs to local Entity so should be mapped to A#Local_Tax and Amount $9000 belongs to overseas Entity so should be mapped to A#Overseas_Tax. The problem is in the import file the amounts 7k and 9K sit in both local accounts Acc 1000 and Acc 2000. The only unique identifier is the Text 7 value in the Entity. Please advise if I can use this text value in Composite Transformation rule or if I need a complex business rule. Any suggestions are welcome, 

Thanks

Sam

2 Replies

  • MarcusH's avatar
    MarcusH
    Valued Contributor

    You cannot use a Composite Rule as that can only reference metadata members in the Rule Expression. You can look up metadata properties from a complex expression. This is an example that checks the value of Text1 on a UD2 member:

     

     

    ' Get the target UD2 member
    Dim TargetU2 As String = args.GetTarget("U2#")
    ' Get the UD2 member id
    Dim iUD2Id As Integer = BRApi.Finance.Members.GetMemberId(si, DimType.UD2.Id, TargetU2)
    ' Get the workflow cluster
    Dim wfClusterPK As WorkflowUnitClusterPk = si.WorkflowClusterPk	
    ' Get the scenario and time POV from the workflow
    Dim	iScenarioID As Integer = wfClusterPK.ScenarioKey
    Dim iTimeID As Integer =  wfClusterPK.TimeKey	
    ' Get the Text1 property for the target UD2 member
    Dim Text1 As String = BRApi.Finance.UD.Text(si, DimType.UD2.Id, iUD2Id, 1, iScenarioID, iTimeID)

     

     

  • Sam_OS's avatar
    Sam_OS
    New Contributor

    Thanks Marcus for your reply. Will check your example rule, Sam