Skip to main content

Notifications

Microsoft Dynamics CRM (Archived)

Custom Action Cannot Be Called From WebAPI

Posted on by Microsoft Employee

I have developed an unbound custom action.  At this point it does nothing more than set and return a string argument.  I can see the action in the $metadata file.

<ComplexType Name="sos_GetJobByPOResponse">
   <Property Name="PurchaseOrder" Type="Edm.String" Nullable="false" Unicode="false"/>
</ComplexType>
<Action Name="sos_GetJobByPO">
  <ReturnType Type="mscrm.scs_GetJobByPOResponse" Nullable="false"/>
</Action>

When I call the action through a web api call - https://[my instance].api.crm.dynamics.com/api/data/v8.2/sos_GetJobByPO - I get the following response:

{
    "error": {
        "code": "",
        "message": "No HTTP resource was found that matches the request URI 'http://[my instance ].api.crm.dynamics.com/api/data/v8.2/sos_GetJobByPO'."
    }
}

Any ideas on what I need to do to get the Web API call to work?

*This post is locked for comments

  • Suggested answer
    RE: Custom Action Cannot Be Called From WebAPI

    Digging up an old thread here, but just had the same issue. The solution was to put the action name in lower case. Not sure why this should matter in a URL, but it does.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom Action Cannot Be Called From WebAPI

    I tried that.  It did not work.  The response I got was the same one I get when I put in an invalid action name.  I think you only need to fully qualify bound actions.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom Action Cannot Be Called From WebAPI

    This is an unbound action.

  • Suggested answer
    a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Custom Action Cannot Be Called From WebAPI

    Still not visible...

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom Action Cannot Be Called From WebAPI

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Custom Action Cannot Be Called From WebAPI

    Here is the screen shot of the action

  • Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Custom Action Cannot Be Called From WebAPI

    Hi Lynn,

    Is the custom action a global one or entity specific one?

    If it is a Global Action, you can use the URL below.

    https://[my instance].api.crm.dynamics.com/api/data/v8.2/sos_GetJobByPO

    If it is an Entity-Specific Action, you should use the URL below. 

    https://[my instance].api.crm.dynamics.com/api/data/v8.2/accounts(DE57510E-59A3-E511-80E4-3863BB35AD90)/Microsoft.Dynamics.CRM.sos_GetJobByPO

    In the above URL, accounts should be replaced by the logicalName of the entity of action appended with 's' and DE57510E-59A3-E511-80E4-3863BB35AD90 is the GUID of the entity record you need to perform the entity-specific action.

    Hope this helps.

  • Suggested answer
    SCV Profile Picture
    SCV 1,004 on at
    RE: Custom Action Cannot Be Called From WebAPI

    Try changing your url to this and see:

    http://[my instance ].api.crm.dynamics.com/api/data/v8.2/Microsoft.Dynamics.CRM.sos_GetJobByPO

  • a33ik Profile Picture
    a33ik 84,323 Most Valuable Professional on at
    RE: Custom Action Cannot Be Called From WebAPI

    Hello,

    Can you please post a screenshot of your action?

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,188 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans