Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Task Ownership

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

How can i set the default owner of the task to be the parent owner (regarding owner)

E.g. if you open an opportunity form and create the task from it, then be default the owner should be the opportunity owner instead of current logged in user.

*This post is locked for comments

  • Suggested answer
    Shahbaaz Ansari Profile Picture
    Shahbaaz Ansari 6,203 on at
    RE: Task Ownership

    Hi Mudassar,

    You can create plugin on the task entity, and check in condition in your plugin if the owner of the opportunity is not same as logged in user then you update the owner of the task by using below code,

    // Create the Request Object and Set the Request Object's Properties

    var request = new AssignRequest

    {

      Assignee = new EntityReference(SystemUser.EntityLogicalName, _newOwnerId),

      Target = new EntityReference(Account.EntityLogicalName,  _TaskId)

    };

    // Execute the Request

    _service.Execute(request);

    Please go through this link :community.dynamics.com/.../how-to-get-the-new-owner-of-a-record-in-a-plugin-dynamics-crm-4

    Hope this helps,

    Best Regards,

    Shahbaaz

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans