Thursday, 16 June 2016

Dynamics CRM - Attribute Mapping Issue

Dynamics CRM, like most software products, will have bugs. Most aren't world ending to be fair, but often those slightly less visible ones linger for quite some time. Take this issue I came across today.

We have a custom entity in our system which has 3 lookups to the account entity. Each lookup serves a different purpose:


  • Company
  • PR Company
  • Joint Broker
All of the above are a different type of account in our system, but are accounts all the same. You can see the problem that exists straight off if you take a look under the hood. Open up one of the relationships and check the mappings section. It contains all 3 of the above as part of the attribute mapping.



The issue with this is if you open an account and create a new one of these custom records (from any relationship) it will populate ALL three of the lookups with the same account. You cannot delete these mappings, or disable them. Unfortunately you are stuck with them. This bug has existed for at least 2 years going by an issue raised in CRM community forum back in 2014.

So what is the workaround?

If you need this populated based on the relationship that the record was created through, you might be in a bit of a pickle. I currently know of no supported way to do this without writing your own add buttons to the ribbons, but that is quite a lot of effort for very little reward.

On the other hand, if you only ever want 1 (or particular) lookups populated there is a way to fix it.Write a JavaScript function a bit like the following:


function FixAttributeMappings() {
    // If we are in a create form blank the attribute mappings
    if (Xrm.Page.ui.getFormType() == 1) {
        Xrm.Page.getAttribute("new_jointbroker").setValue(null);
        Xrm.Page.getAttribute("new_prcompany").setValue(null);
    }
}

Call that function in the OnLoad of your entity and they are blanked whenever you create a new record of that type.



3 comments:

  1. That is very interesting; you are a very skilled blogger. I have shared your website in my social networks! A very nice guide. I will definitely follow these tips. Thank you for sharing such detailed article.
    Best CRM System

    ReplyDelete
  2. Hello All ▲▲▲ I am Dianna Kent and I live in Nevada, U.S .I am a full member of the Illuminati brotherhood, and am among the 1252 lodge. ▲▲▲ Iwas ordained by the Grand-master to go out to the world and bringmore members to the Illuminati, ▲ so I was requested to get 400Recruits for the brotherhood, I have 210 new recruits already. I amlooking for only 190 more to go,▲I am sure you want to be amongthe 190 people that will be earning $500,000 monthly and a brandnew car, ▲so add me up now so we can achieve this great chanceof being rich ▲. You get to live your dream life on earth filled with luxury. so i urge you not to miss thisGreat opportunity becoming what you long wished for life email: illuminatitemple6634@gmail.com‬ or Whats-app +1(854) 220-5771 for guidance





    Hello All ▲▲▲ I am Dianna Kent and I live in Nevada, U.S .I am a full member of the Illuminati brotherhood, and am among the 1252 lodge. ▲▲▲ Iwas ordained by the Grand-master to go out to the world and bringmore members to the Illuminati, ▲ so I was requested to get 400Recruits for the brotherhood, I have 210 new recruits already. I amlooking for only 190 more to go,▲I am sure you want to be amongthe 190 people that will be earning $500,000 monthly and a brandnew car, ▲so add me up now so we can achieve this great chanceof being rich ▲. You get to live your dream life on earth filled with luxury. so i urge you not to miss thisGreat opportunity becoming what you long wished for life email: illuminatitemple6634@gmail.com‬ or Whats-app +1(854) 220-5771 for guidance




    Hello All ▲▲▲ I am Dianna Kent and I live in Nevada, U.S .I am a full member of the Illuminati brotherhood, and am among the 1252 lodge. ▲▲▲ Iwas ordained by the Grand-master to go out to the world and bringmore members to the Illuminati, ▲ so I was requested to get 400Recruits for the brotherhood, I have 210 new recruits already. I amlooking for only 190 more to go,▲I am sure you want to be amongthe 190 people that will be earning $500,000 monthly and a brandnew car, ▲so add me up now so we can achieve this great chanceof being rich ▲. You get to live your dream life on earth filled with luxury. so i urge you not to miss thisGreat opportunity becoming what you long wished for life email: illuminatitemple6634@gmail.com‬ or Whats-app +1(854) 220-5771 for guidance

    ReplyDelete