Forum Discussion

cons1's avatar
cons1
New Contributor III
5 months ago
Solved

Get dependent entities on a review level workflow

Hi All, We have a parameter attached in the entity POV of all our cube views, and it works perfectly on base level. However, not in the review level workflow. Is there a way to include dependent ...
  • JackLacava's avatar
    5 months ago

    To clarify: you want the Entities assigned to workflows that are set as Named Dependents of a particular workflow? 

    This shows how to do it, drop it into a DataSet rule and parameterize as necessary.

    Dim profileName = "Canada Clubs"
    Dim wfProfileInfo As WorkflowProfileInfo = BRApi.Workflow.Metadata.GetProfile(si,profileName )
    Dim result As New DataTable("DepEntities")
    result.Columns.Add("EntityName", GetType(String))
    result.Columns.Add("EntityId", GetType(Integer))
    
    For Each wfpi As WorkflowProfileInfo In wfProfileInfo.NamedDependentInfo.DependentProfiles()
    	
    	Dim ents = BRApi.Workflow.Metadata.GetDependentProfileEntities(si, wfpi.ProfileKey)
    	For Each ent As BaseNameIntPairInfo In ents
    		Dim newRow = result.NewRow()
    		newRow("EntityName") = ent.Name
    		newRow("EntityId")= ent.UniqueID
    		result.Rows.Add(newRow)
    	Next
    Next
    Return result