Skip to main content

Notifications

Dynamics 365 Community / Forums / Human Resources forum / Getting delegates with...
Human Resources forum

Getting delegates with plugin

Posted on by 100

Hi,

I wanted to create an automatic mail for new delegates. Like "Hey mate, you are now delegated to job 'abc' with role 'hiring manager' granted by 'user'."

But the delegate connection is stored in the "msdyn_jobopeningparticipant_cdm_workerSet" property which cannot be searched or viewed. Not in GUI, not in Flow, not with CDS QueryExpression. That's really annoying. I found the entity with some luck here: https://<orgid>.crm4.dynamics.com/XRMServices/2011/OrganizationData.svc/msdyn_jobopeningparticipant_cdm_workerSet

Is there a way to get the delegates programmatically?

Best,

Robin

Categories:
  • Verified answer
    Robin Pi Profile Picture
    Robin Pi 100 on at
    RE: Getting delegates with plugin

    Code is:

                                           QueryExpression query = new QueryExpression("msdyn_jobopeningparticipant_cdm_worker");
    
                                           query.ColumnSet = new ColumnSet(new string[] { "cdm_workerid" });
    
                                           query.Distinct = true;
    
                                           query.Criteria = new FilterExpression();
    
                                           query.Criteria.AddCondition("msdyn_jobopeningparticipantid", ConditionOperator.Equal, hiringManager.GetAttributeValue<Guid>("msdyn_jobopeningparticipantid"));
    
                                           EntityCollection delegates = service.RetrieveMultiple(query);

    You will get workerid, so you get worker entity and can get their email address..

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,818 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,147 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans