Skip to main content

Notifications

Customer experience | Sales, Customer Insights,...
Answered

how we can allow this with the help of plugin to trigger this check box

Posted on by 365

pastedimage1604581430979v1.png

  • unbeatable Profile Picture
    unbeatable 365 on at
    RE: how we can allow this with the help of plugin to trigger this check box

    using System;

    using System.Collections.Generic;

    using System.Linq;

    using System.Text;

    using System.Threading.Tasks;

    using Microsoft.Xrm.Sdk;

    using Microsoft.Xrm.Sdk.Query;

    namespace sample.sampl1

    {

       public class test : IPlugin

       {

           public object Service;

           public Guid userId { get; private set; }

           public void Execute(IServiceProvider serviceProvider)

           {

               IPluginExecutionContext context = (IPluginExecutionContext)

               serviceProvider.GetService(typeof(IPluginExecutionContext));

               Entity entity = (Entity)context.InputParameters["Target"];

               //Entity Name

               Entity userSetting = new Entity("usersettings");

               //Guid Of the user record

               userSetting.Id = userId;

               //Attribute to set value of “Allow other Microsoft Dynamics 365 user to send email on your behalf”

               userSetting["issendasallowed"] = true;

               //Update the Record

               Service.Update(userSetting);

           }

       }

    }

    getting error in this code

  • Verified answer
    Pawar Pravin  Profile Picture
    Pawar Pravin 5,227 on at
    RE: how we can allow this with the help of plugin to trigger this check box

    Hi ,

    Please refer below url :

    www.inogic.com/.../

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans