Forum Discussion

KhimCastillo's avatar
KhimCastillo
New Contributor II
7 months ago

WFText2 used as UD2DropDown and Loop in Confirmation Rule

Hello,

I have a list of segments in WFText2 that I use as UD2 dropdown selection for my cube view.

 

 So whenever I open my Form/Cube View I can see all segments excluding GBA_021, GBA031, GBA_032 and GBDP_001,  in UD2 Dropdown selection.

My dilemma is, I am creating a confirmation rule that will loop for each UD2 that were not stated to be removed.

I use this to get Text2:

Dim WFText2 As String = brapi.Workflow.Metadata.GetProfile(si,si.WorkflowClusterPk.ProfileKey).GetAttributeValue(ScenarioTypeID.ScenarioType1, SharedConstants.WorkflowProfileAttributeIndexes.Text2)

And the entire UD2:

Dim GBA As List(Of Member) = api.Members.GetBaseMembers(api.Pov.ud2Dim.DimPk, api.Members.GetMemberId(dimtype.ud2.Id,"gba"))

I initially used this GBA in my confirmation rule but it also includes those that were removed in WFText2 in the loop.

 

Any advise would be helpful.

  • FredLucas's avatar
    FredLucas
    Contributor III

    Hi KhimCastillo,

    I might have misunderstood your question, but if what you want is to loop through the list specified by the filter on your WFText2 you could try something like this:

    'I've your WFText2 code here
    Dim WFText2 As String = brapi.Workflow.Metadata.GetProfile(si,si.WorkflowClusterPk.ProfileKey).GetAttributeValue(ScenarioTypeID.ScenarioType1, SharedConstants.WorkflowProfileAttributeIndexes.Text2)
    
    'Then use if as part of the MemberFilter (prefixing the U2# to the WFText2 filter).
    Dim validUD2List As List(Of MemberInfo) = BRApi.Finance.Members.GetMembersUsingFilter(si, api.Pov.ud2Dim.DimPk, $"U2#{WFText2}", True)
    

    Hope this helps.