none
'Cannot specify child attributes in the columnset for Retrieve' when Merging?

    Question

  • Hi all

    Am performing a merge using the code below:

     

    foreach (account duplicate in duplicates)
    {
    MergeRequest merge = new MergeRequest();
    merge.Target = target;
    
    merge.SubordinateId = duplicate.accountid.Value;
    merge.PerformParentingChecks = false;
    merge.UpdateContent = master;
    
    MergeResponse merged = (MergeResponse)service.Execute(merge);
    }
    

     

    Duplicates here is a List<account> collection.

    Master is an instance of an account object.

    However when the service.Execute(merge) is called a SOAP exception is generated with the following message:

     

    <error>
    
     <code>0x8004023b</code>
    
     <description>Cannot specify child attributes in the columnset for Retrieve. Attribute: owneridname</description>
    
     <type>Platform</type>
    
    </error>
    
    

     

    But as far as I know I am not retrieving nor trying to set that property so am confused as to why that message would be generated?

     

    Any pointers?

    If you need more info, please just ask!

    • Edited by glosrob Wednesday, November 03, 2010 9:55 AM Providing extra clarification, previous update has not shown up for some reason.
    Wednesday, November 03, 2010 9:53 AM

All replies

  • OK it gets stranger.

    If I explicitly set the 'name' property of each and every lookup (standard and custom lookup properties) to string.Empty, the accounts merge fine.

    e.g.

    account.ownerid.name = string.Empty;

    account.transactioncurrencyid.name = string.Emtpy;

    etc. etc.

    This is CRM5 Beta, if that makes a difference.

    Thursday, November 04, 2010 1:53 PM
  • Did you find a solution to this problem without the hack? We have the exact same problem and at moment the hack seems to work, but I am looking for a "cleaner" version.
    Tuesday, May 31, 2011 5:35 AM
  • Unfortunately not - not long after this post, this part of the project was put on hold so I haven't had a chance to retry under the RTM version of CRM5. I wouldn't envisage picking it up again until around the end of June/July.
    Tuesday, May 31, 2011 7:00 AM
  • I have the same deal where it seems like it's trying to decompose a lookup (entityreference.)  Maybe it just doesn't want to get any lookups as merge parameters.  I'm going to just try taking them out to see if they merge without me specifying.
    Friday, May 31, 2013 5:37 PM
  • Yeah, taking the entityReferences out of the MergeRequest clears the error, but then the lookup values don't get brought over.
    Friday, May 31, 2013 8:59 PM
  • I find that you have to deal with the entityreferences by constructing new ones (yes, that sucks:)

        if (match.Contains("new_mostrecentcampaign")) 
            master["new_mostrecentcampaign"] = 
                new EntityReference(match.GetAttributeValue<EntityReference>("new_mostrecentcampaign").LogicalName
                                  , match.GetAttributeValue<EntityReference>("new_mostrecentcampaign").Id);
    ...
        UpdateContent = master
    ...

    But I would also mention that you don't want to just throw a whole entity at it.  There are attributes in the other entity that you won't want to copy -- its id, created on/by, modified on/by, ...  You should remove them first.  And you have to put your hands on the lookups anyway.

    • Proposed as answer by mardukes Tuesday, September 10, 2013 2:28 PM
    Tuesday, September 10, 2013 2:27 PM