Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

365 Online - How to call custom action (by code) from webapi?

Posted on by Microsoft Employee

From here, I understand a custom api with custom action is doable on dynamics 365.

And according to here, custom auction by code is only supported by on-premises/IFD server;

But the next section says you can pack action by code in solution to distribute it as well.  (which 365 online can import a solution)

This is confusing. My question is - is it doable? If yes, is there any guide on this? I have no idea on how to start coding it, the second link above look like a section of code to me and not complete.

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: 365 Online - How to call custom action (by code) from webapi?

    Well because I am totally stupid and didn't even think about that.... great suggestion!

  • Verified answer
    ashlega Profile Picture
    ashlega 34,475 on at
    RE: 365 Online - How to call custom action (by code) from webapi?

    Hi Klc,

     custom actions can be added to the solutions and distributed that way. For example, if you look at the FieldService or ProjectService, you'll see a lot of custom actions that come with those solutions. I'd second Ravi in his question.. why do you need to do it from code? You just need to create the action in your environment, add it to a solution (with all the plugins/steps if there are any), and, then, distribute that solution to the clients.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: 365 Online - How to call custom action (by code) from webapi?

    For my company, we want to create something reusable that clients can just import.

    Create from UI is viable, but it could be a lot of trouble and error prone for clients - as what we want to do involves multiple steps and across multiple entities.

  • RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: 365 Online - How to call custom action (by code) from webapi?

    So you want to create custom action by code and not from UI?

    Sorry but I haven't created the custom action from code :|

    May be someone else can assist on this.

    Out of curiosity, why do you want to create it from code and not from UI? Any specific requirement?

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: 365 Online - How to call custom action (by code) from webapi?

    Sorry for being unclear. What I mean is I want to implement the action by code (c#), not building the action by screens.

    If my understanding is correct, both examples codes are not action itself; They are calling actions built from screen.

  • Suggested answer
    RaviKashyap Profile Picture
    RaviKashyap 55,410 on at
    RE: 365 Online - How to call custom action (by code) from webapi?

    What exactly you are looking for. You can create custom action in D365 Online, add it to a solution to distribute it as well.

    The second link you have mentioed is about creating the custom action itself by code instead of UI (Settings >> Process >> {new process of type custom})

    www.powerobjects.com/.../actions-in-dynamics-crm-2013

    You can call this custom action from code as well-

    JavaScript:

    community.dynamics.com/.../web-api-executing-custom-action-via-javascript

    Plugin

    deepakexploring.wordpress.com/.../calling-actions-from-plugin-in-crm-2013

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans