Friday, 12 January 2018

How to find workflows running on the user context in MS CRM

How to find workflows running on the user context in MS CRM using sql

Sql query to get all workflows which are running on user's context, workflowbase table in ms crm

Recently i needed to find out all the workflows which are running in the context of  the user who made changes to the record. To quickly find out the same we need to query workflowbase
 table in crm db.

Below is the query.

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Select 
distinct(W.name)
 from workflowbase as W
join SystemUser  as S
on W.OwnerId=S.SystemUserId
where S.FullName = 'CRM Admin'
and W.IsCrmUIWorkflow=1 --
and W.RunAs=1 --1 the user who made changes to the record 0-owner of the workflow
and W.ParentWorkflowId is   null --For workflow header rows only
and mode=0 --for real time workflow only 0- real time 1-background
and w.Category=0 --Category 2- Business rule and 0 is workflow
order by W.name

/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////

Happy CRMing

6 comments:

  1. Nice post ! Thanks for sharing valuable information with us. Keep sharing..
    Microsoft Dynamics Online Training

    ReplyDelete
  2. It is amazing to visit your Blog.Thanks for sharing this information,this is useful to me..
    D365 Finance and Operations Online Training

    ReplyDelete
  3. I cannot thank Mr Benjamin service enough and letting people know how grateful I am for all the assistance that you and your team staff have provided and I look forward to recommending friends and family should they need financial advice or assistance @ 1,9% Rate for Business Loan .Via Contact : .  247officedept@gmail.com. WhatsApp...+ 19893943740. Keep up the great work.
    Thanks, Busarakham.

    ReplyDelete
  4. Do you need Finance? Are you looking for Finance? Are you looking for finance to enlarge your business? We help individuals and companies to obtain finance for business expanding and to setup a new business ranging any amount. Get finance at affordable interest rate of 3%, Do you need this finance for business and to clear your bills? Then send us an email now for more information contact us now via (financialserviceoffer876@gmail.com) whats-App +918929509036 Dr James Eric Finance Pvt Ltd Thanks

    ReplyDelete
  5. This comment has been removed by a blog administrator.

    ReplyDelete