Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 79901

get systemjob id of current running system job (AsyncOperation Entity)

$
0
0

I'm in a dynamics crm 2015 plugin, that is triggered by the sdk message step "assig of task" and run asynchronly. In Execute(IServiceProvider serviceProvider) method, i want to search for other currently running system jobs, using a QueryExpression

QueryExpression systemjobq = new QueryExpression
            {
                EntityName = "asyncoperation",
                ColumnSet = new ColumnSet("name", "createdon", "completedon", "regardingobjectid", "asyncoperationid", "startedon", "messagename", "statuscode"),
                Criteria = new FilterExpression
                {
                    Conditions = 
                    {
                        new ConditionExpression 
                        {
                            AttributeName = "name",
                            Operator = ConditionOperator.Equal,
                            Values = { "My system jobs name" }
                        }
                       }
                   }                  
            };

Because I don't want to find "myself" - the currently running system job i need to find out the asyncoperationid of the currently running system job that executes my plugin, so i can include it into my search query expression.

So, how can I find out the asyncoperationid of the currently running system job?

Thx in Advance

Dennis


Viewing all articles
Browse latest Browse all 79901

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>