Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

CRM Web API - Changes to Custom Action metadata doesn't refresh through WebAPI

Posted on by 90

Hi all,

I am not sure if I am the only one having this problem because I don't find much help in Google. The background is that I have created a custom action with 2 input arguments of type EntityReference and a custom activity. As per our business scenario, only one of this entity reference will have a value, and other will be null. But as explained in this post, we have to pass a non-null value to both parameters unless we want to get a null reference exception (which was true in my case, even though the exception was not from my custom activity). Hence I had to change the input argument type to String and pass empty string ("") instead of null value.

The problem is, when I call this custom action through Web API, the values are not passed to my custom activity. But the same values are passed correctly using SOAP end point. Actually this is not the first time, it has happened and I have faced this issue before. I simply created a new action with a different name and it works fine. But I want to get to the root of it.

Has anyone faced this issue? What do I have to do in case I want to keep using Web API for calling this action and don't want to create a new action? A comparison of both calls.

8132.Code.png

*This post is locked for comments

  • Suggested answer
    Mattias007 Profile Picture
    Mattias007 15 on at
    RE: CRM Web API - Changes to Custom Action metadata doesn't refresh through WebAPI

    Hi all,

    I also had this issue that my action didn't show up in the metadata. In my case the action has 2 output parameters. I tried with publish all customizations and iisreset but it still didn't show up in the metadata. What finally resolved the issue was when I removed one of the output parameters. Then it showed up in the metadata, and I could call it with Web API. For reference we use the 8.2 endpoint on on-premise.

  • Ahmad Pirani Profile Picture
    Ahmad Pirani 90 on at
    RE: CRM Web API - Changes to Custom Action metadata doesn't refresh through WebAPI

    For me it is over a week now and my custom action metadata has not refreshed. I added couple of parameters, one input and one output.

    Strangely, when I first created this custom action, it won't show up in the metadata, unless I add a output parameter. After adding a output parameter, the custom action showed up but it never showed the output parameter in the metadata. Just the those parameters that I had added during the creation process.

    I wonder if metadata can be forced refreshed or did Microsoft intentionally did this "by design", their standard answer to things they screwed up on.

  • Verified answer
    Johninfant Profile Picture
    Johninfant 90 on at
    RE: CRM Web API - Changes to Custom Action metadata doesn't refresh through WebAPI

    Hi Andrew/Alok Srivastav,

    Thanks for the replies.

    I missed to take the screenshot of metadata yesterday, but today it seems fine. The arguments are changed to string type and the values are getting passed. May be it takes a while to refresh the Wep API metadata. Not sure how long it is, but some time back, I have tried to fix this issue for nearly 2 hours and it persisted. May its refreshed by EOD?

    Plugin trace log from today. 

    New-Code.PNG

  • Dynamics_Alok Profile Picture
    Dynamics_Alok 1,746 on at
    RE: CRM Web API - Changes to Custom Action metadata doesn't refresh through WebAPI

    What is the response of REST Builder .Please try to create Action call  request using REST Builder and execute it .May be you would get some insight.Changing Parameter type is the cause and it may be stored in Server Cache.

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: CRM Web API - Changes to Custom Action metadata doesn't refresh through WebAPI

    Hello,

    Check the metadata of your activity using Url - yourorgname.crm.dynamics.com/.../$metadata

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans