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