Calling bound actions (entity actions) using Xrm.WebApi.execute in Dynamics V9

This is a follow up to my previous blog where I showed you how can you call a global action with all parameter types using the newly introduced Xrm.WebApi.execute method.


Now coming to bound actions i.e actions which are bound to entities, I was getting multiple queries on how to do it after my first blog post. Readers were telling that they are unable to call the action after repeated trials. I was perplexed. So I thought, why not give a try.

So I created a very simple action with the below details:


Name: new_TestProcess

Bound to entity: Account

Input Parameter – EntityReference of type custom entity named new_TestEntity



So harmless isn’t it. Even I was thinking the same till it took me more than couple of hours to figure out on how to call this action using Xrm.WebApi.execute.

So let’s dive into the code. The first thing we need to understand is how to pass the parameter for the bound entity. In other words this action will always be called on account record. And how do you pass the account record reference?

Well, the first thing that came to my mind is the input parameter must be named as “Target”. After all that is the convention created by Microsoft right? Well in-fact it’s bit different. It’s not “Target”. Then how do I find out the parameter name.

  • Settings –> Customizations –> Developer resources
  • Dowload Web Api Metadata


  • Once downloaded, open up the metadata in Visual studio or any other XML editor of your choice. Search for your action. In this case – “new_TestProcess”.
  • Below is my metadata for my action. See the highlighted line. From that it is clear that the bound entity parameter type is “entity” and not “Target”



Ok, past the first hurdle. Now comes my nightmare.

Highlighting Microsoft Documentation for Xrm.WebApi.execute below


Well, a very detailed documentation I would say. Everything is pretty much explained. But let’s shift our focus to to the highlighted line which says that for entity actions, we need to set the boundParameter to entity logical name or entity set name. Well, that’s when my ordeal started.

Started with all possible combinations like “mscrm.account”/ “Microsoft.Dynamics.CRM.Account”/”account”/”accounts” and a host of illogical others which are all ridiculous. Smile

Finally just before giving up , I started debugging and went around whichever files the browser takes me in while debugging. And finally eureka moment when I realized that you need to set the value of boundParameter to the word “entity”. Could anyone imagine that from the statement in the documentation.

And finally piece of code below for you

var target = { entityType: "account", id: "78FA0233-7D86-E811-A94D-000D3A3AB6B4" };

    var reqObject = {};
    reqObject.entity = target;
    reqObject.ArgEntRef = { "@odata.type": "Microsoft.Dynamics.CRM.new_testentity", "": "C182D39E-6B8B-E811-A94D-000D3A3AB6B4" }

    reqObject.getMetadata = function () {
        return {
            boundParameter: "entity",
            operationType: 0,
            operationName: "new_TestProcess",
            parameterTypes: {
                "entity": {
                    typeName: "mscrm.account",
                    structuralProperty: 5
                }, "ArgEntRef":{typeName: "mscrm.new_testentity",
                    structuralProperty: 5}

        function (data) {
            var e = data;
        function (error) {
            var errMsg = error.message;


Hope this helps!

-Debajit Dutta

(Dynamics MVP)

For consultation/ training visit or reach out to us at

6 thoughts on “Calling bound actions (entity actions) using Xrm.WebApi.execute in Dynamics V9”

  1. Debajit,

    good stuff, the docs are a little ambiguous, but in their defence the definition does say “The *name* of the bound *parameter* for the action or function to execute. ” (highlights mine)

    To help them improve, why don’t you provide the feedback on the documentation page? If relevant, it’ll be fixed within couple days (speaking from experience).


    1. Hi George, taken your suggestion and provided the feedback. The confusing statement is – “Specify entity logical name or entity set name in case the action or function to execute is bound to one.” This is the one which makes it confusing at the end.

  2. Hi Debajit,

    its a nice experiment.

    Is it possible to show the Executemultiple example and one function example?
    waiting for your reply

  3. Hi Debajith,

    I have a similar requirement. Created a global action and tried to call that from script. Everything is working perfect as expected on web client but not on UCI. Unable to figure out the exact issue behind this. Is it a known bug on UCI? Awaiting your response. Thank you.

      1. Hi Debajit,

        In UCI, the successcallback, doesn’t contain responseText. Below code would work for both the clients. Thank You.
        return response.json();
        return error;
        //Use the Action Output parameters here or anyother custom logic
        //Handle exceptions here

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s