{Quick Fix} Qualify button on Lead not working in Dynamics 365

I have been working with Customer IT Team on a Dynamics 365 project and we have been doing kind of fancy stuffs, new features and what not. And suddenly we are being reported that Qualify button on lead form is not working. However the same is working from the “Home Page grid”.

First glance and I thought – Must be some silly tampering with the Qualify button. However one quick inspection with Ribbon Workbench negated that suspicion. How can such a stuff working for years can’t work all of a sudden in our environment? Product Bug? Can’t be for sure. It’s been working for years!

After beating around the bush, we finally decided to keep a back-up of our customizations and restored vanilla lead form from different environment. Qualify button started working like piece of cake.

In curiosity, to find out what caused the issue, I started removing one field after the other and finally found that the magic field was “Company Name” field. The moment I removed that, Qualify stops working.

Strange isn’t. But that’s how it works.

Honestly, Qualify button may not work for host of reasons but if you find yourself banging your head over this functionality, this article might just make your day!

Hope this helps

 

Debajit Dutta

(Dynamics MVP)

For training/ consulting please visit www.xrmforyou.com or write to us at info@xrmforyou.com

Advertisements

{Zero Code development} Putting images in Dynamics 365 view for encoding Case severity

Another fantastic article for Deepesh Somani

MSDYNAMICSBLOG BY DEEPESH

Business Requirement: Often there is requirement to show Case severity in some colour encoded way in Dynamics 365. For example, refer image below:

clip_image002

Solution: Below steps can be used to achieve this requirement without writing code:

1. Go to Settings->Customization->Entity->fields and add a new field of type Option Set. In the example above I have created a new field Case Severity on Case entity. Add items text from the following link: http://classic.getemoji.com/

Following images were used in the above example:

clip_image004

clip_image006

2. Add the column as the first field in Active Case view and other views that you wish. Optionally, you can also place the field on the Case entity form. Next, in the editable grid you will be able to set the priority by this field:

clip_image008

3. Not only that, you will be able to group as well by selecting Group by:

clip_image010

Hope it helps and Happy CRMing.

Any…

View original post 43 more words

{Dynamics Version 9.0} Execute custom action with all parameter types in Dynamics CRM Version 9.0

Dynamics Version 9.0 introduced the Xrm.WebApi namespace which provides all the methods to interact with dynamics CRM server from client side script.

Detailed Documentation – https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi

However recently I was working on a project to upgrade the SOAP calls from client and replace them with the new Xrm.WebApi methods. Create/ delete/ update were kind of easy and was easily ported to the new API’s.

However then came the Actions. The client had actions which had many input parameters and which were getting invoked from the client using SOAP calls. We had to port them to the Xrm.WebApi. But in Xrm.WebApi we did not had any function like executeAction. But the Xrm.WebApi.execute came to our rescue.

Let’s first examine Xrm.WebApi.execute method. Microsoft documentation shows it like this –

Xrm.WebApi.execute(request).then(successCallback, errorCallback);

For the sake of brevity of this blog post, I am skipping the documentation of the parameters. For detailed information on the parameters, please refer the below Microsoft documentation link – https://docs.microsoft.com/en-us/dynamics365/customer-engagement/developer/clientapi/reference/xrm-webapi/execute

 

So how to call an action with input parameters? For this post, I created an action named “new_TestAction”. The action is global. It has the following input parameters.

  • Name – Type (string)
  • Age – Type(string)
  • InputEntityReference – Type (EntityReference)
  • InputEntity – Type (Entity)
  • InputEntityCollection – Type(EntityCollection)

For entityreference, entitycollection and entity, I have kept the Entity as Account Entity. All set and done. Now the next step is to call the action. below is the sample code to create the request object. All the important parameters has been highlighted and appropriate comments put.

TestAction1: function (input1, input2, inputEntityReference, inputAccount, inputAccountCollection) {
        this.InputEntityReference = inputEntityReference;
        this.Input1 = input1;
        this.Input2 = input2;
        this.InputEntity = inputAccount;

        this.InputEntityCollection = inputAccountCollection;

        this.getMetadata = function () {
            return {
                boundParamter: null, // for entity action, put the entitysetname/ entitylogicalname here
                parameterTypes: {
                    "Input1": {
                        "typeName": "Edm.String",
                        "structuralProperty": 1 // Primitive Type
                    },
                    "Input2": {
                        "typeName": "Edm.String",
                        "structuralProperty": 1 // Primitive Type
                    },
                    "InputEntityReference": { // Entity Reference
                        "typeName": "mscrm.account",
                        "structuralProperty": 5
                    },
                    "InputEntity": { // entity
                        "typeName": "mscrm.account",
                        "structuralProperty": 5
                    },
                    "InputEntityCollection": { // entity collection
                        "typeName": "mscrm.account",
                        "structuralProperty":4 // collection type
                    }
                },
                operationType: 0, // 0 for action, 1 for function and 2 for CRUD
                operationName: "new_TestAction1"
            };
        };
    }

Next is the code to create this request object and pass the object to the action.

ExecuteAction: function () {
        debugger;
        var accountReference = {
            "@odata.type": "Microsoft.Dynamics.CRM.account",
            "@account.id": "9602CEB2-55F7-E711-A954-000D3A34A0AA"
        };
        var accountEntity = {
            "@odata.type": "Microsoft.Dynamics.CRM.account",
            "@account.id": "9602CEB2-55F7-E711-A954-000D3A34A0AA"
        };
        var accountEntityCollection =[
            {
            "@odata.type": "Microsoft.Dynamics.CRM.account",
            "@account.id": "9602CEB2-55F7-E711-A954-000D3A34A0AA",
            "name": "Test Account 1"
            },
            {
            "@odata.type": "Microsoft.Dynamics.CRM.account",
            "@account.id": "9602CEB2-55F7-E711-A954-000D3A34A0AA",
            "name": "Test Account 1"
            }];
        var requestObject = new TestAction1("Name", "Age", accountReference, accountEntity, accountEntityCollection);
        Xrm.WebApi.execute(requestObject).then(function (result) {
            debugger;
        },
        function (error) {
            debugger;
            console.log(error.message);
        });
    }

Simple isn’t it. I haven’t covered the other primitive types like – Decimal/ Int. They are pretty simple like for int, it is Edm.Int32.

Hope this helps!

 

-Debajit Dutta

(Dynamics MVP)

For consultation/ training visit www.xrmforyou.com or reach out to us at info@xrmforyou.com