Skip to main content

Notifications

Dynamics 365 general forum
Answered

Delete system attribute mapping

Posted on by 110

Hello,

I have a problem to delete mapping between lead and opportunity.  I have removed the dependencies (which means a field on the form) but still I am having an error message that "Cannot create or delete system attribute map having id ----------------------- from leadid to originatingleadid belonging to an entity map with id ------------------------- from lead to opportunity.

I found out that there has been earlier discussion of this topic but that does not offer a solution for me.

https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/376660/cannot-delete-attribute-map

Anyone knows what to do with it?

 

Categories:
  • meelamri Profile Picture
    meelamri 13,198 User Group Leader on at
    RE: Delete system attribute mapping

    Hi,

    would you please close this thread ?

  • Verified answer
    Gilmeyer Profile Picture
    Gilmeyer on at
    RE: Delete system attribute mapping

    Hi,

    This is CRM intended behavior. Whenever you create a lookup field (or its relationship), there is an automatic mapping between the lookup field and the primary key attribute of the source entity in the relationship. In your case, the mapping is between leadid which is the primary key attribute of source entity Lead and the lookup field originatingleadid . This is the system mapping created for this lookup field. You cannot delete it.

  • RE: Delete system attribute mapping

    Hi Tuomas,

    Allow me to ask you why would you want to delete a system attribute mapping?

    Regards

  • Suggested answer
    meelamri Profile Picture
    meelamri 13,198 User Group Leader on at
    RE: Delete system attribute mapping

    Hi,

    It's a known old issue. Unfortunately, You can't delete those mappings. You can clear your data using some JS code. Please refer to the sample code below:

    
    function cancelMappings(executionContext) {
        var formContext = executionContext.getFormContext();
        if (formContext.ui.getFormType() == 1) {
            var mapping1 = formContext.getAttribute("prefix_mapping1");
            if (mapping1.getValue() != null)
                mapping1.setValue(null);
        }
        else
            return;
    }

Helpful resources

Quick Links

Dynamics 365 Community Update – Sep 9th

Welcome to the next edition of the Community Platform Update. This is a weekly…

Dynamics 365 Community Newsletter - August 2024

Catch up on the latest D365 Community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,186 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 227,996 Super User 2024 Season 2

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans