Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Execute Action using Web API, C#, Dynamics 365

Posted on by

Hi all,

I have created an Action with an input parameter of type EntityReference - (Contact Entity).

I want to execute this Action using Web Api C#. I have tried the below code - but I was getting 400 Bad Request message. Can someone help me? 

 JObject actInputParams = new JObject();
                actInputParams.Add("recipientParm", new Guid("49A0E5B9-88DF-E311-B8E5-6C3BE5A8B200"));

                HttpResponseMessage actionResponse =
                    await httpClient.SendAsJsonAsync(HttpMethod.Post, "api/data/v8.2/new_sampleAction", actInputParams);


*This post is locked for comments

  • Ravitheja J Profile Picture
    Ravitheja J on at
    RE: Execute Action using Web API, C#, Dynamics 365

    Hi,

    Thanks for the reply.

    I am looking for C# code snippet, not JS.

  • Suggested answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Execute Action using Web API, C#, Dynamics 365

    I think you need to provide the id of the record on which you want to run the action as well. Also, provide fully qualified name of the action. See below links for reference

    dynamicscrmcoe.com/how-to-call-an-action-through-the-dynamics-crm-web-api

    www.c-sharpcorner.com/.../calling-custom-actions-using-web-api

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