Skip to main content
October 16, 2025
Solved

Function to get the workflow to which an entity is assinged?

  • October 16, 2025
  • 1 reply
  • 0 views

Is there a function, or other method, to get the workflow an enitty is assigned to, if it is assigned?  Seems like an there should be an api for this but for the life of me I can not find it.  Thanks in advance.

Best answer by MarcusH

All the api functions approach from the workflow aspect to show the hierarchy and the workflow attributes. And the Entity is an attribute of the workflow. The options you have are to use the existing api calls such as BRApi.Workflow.Metadata.GetProfileEntities or query the WorkflowProfileEntities table something like this:

SELECT WPH.ProfileName
FROM   WorkflowProfileEntities AS WPE INNER JOIN
   Member AS M ON WPE.EntityMemberID = M.MemberId INNER JOI
   WorkflowProfileHierarchy AS WPH ON WPE.WorkflowProfileKey = WPH.ProfileKey
WHERE (M.DimTypeId = 0) AND (M.Name = 'myentity')

 

1 reply

MarcusHAnswer
October 21, 2025

All the api functions approach from the workflow aspect to show the hierarchy and the workflow attributes. And the Entity is an attribute of the workflow. The options you have are to use the existing api calls such as BRApi.Workflow.Metadata.GetProfileEntities or query the WorkflowProfileEntities table something like this:

SELECT WPH.ProfileName
FROM   WorkflowProfileEntities AS WPE INNER JOIN
   Member AS M ON WPE.EntityMemberID = M.MemberId INNER JOI
   WorkflowProfileHierarchy AS WPH ON WPE.WorkflowProfileKey = WPH.ProfileKey
WHERE (M.DimTypeId = 0) AND (M.Name = 'myentity')