Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

clone record

(0) ShareShare
ReportReport
Posted on by 2,665

HI,

I am trying to implement the solution provided in the below link for cloning the records.

http://www.magnetismsolutions.com/blog/roshanmehta/2012/01/11/Cloning_Records_in_Microsoft_Dynamics_CRM_2011.aspx

But I am not sure what is etc and createformId. Can someone please point me in right direction.

Is 'CreateFormId' the id of the cloned record? And why should the etc be dynamic? Cloning a same entity still needs a new etc?

Please guide me. thanks.

*This post is locked for comments

  • Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: clone record

    Roxana,

    Try to copy the complete URL and remove the &#

    Is that working or not

    Thanks

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: clone record

    Aileen,

    It generates this url.

    [View:https://xxxxx/main.aspx?pagetype=entityrecord&etn=incident&_CreateFromId=&#123:550:50];5A59ADAD-A134-E511-80CF-18A99B144330}&_CreateFromType=112#22035392

    And it opens a blank form.


    This is the script I have:

    function Clone()
    {
    debugger;
    
    var serverUrl=Xrm.Page.context.getClientUrl();
    
    var id =Xrm.Page.data.entity.getId();
    
    URL=serverUrl+"/main.aspx?pagetype=entityrecord&etn=incident&_CreateFromId=" +id+"&_CreateFromType=112";
    
    //Set features for how the window will appear.
        var features = "location=no,menubar=no,status=no,toolbar=no,resizable=1";
    
         // Open the window.
        //window.open(URL+"/main.aspx?etn=incident&extraqs=?_CreateFromId={"+id+"});
    
     window.open(URL, "_blank", features, false);
    }


    Thanks.

  • Aileen Gusni Profile Picture
    Aileen Gusni 44,522 on at
    RE: clone record

    Roxanna,

    Please help to copy url you get from your custom code.

    Thanks

  • anilambadan Profile Picture
    anilambadan 1,160 on at
    RE: clone record

    I just checked the implementation mentioned in the link (on crm 2011) and its working fine. Please try to use encodeURI(uri)

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: clone record

    The 'Add new Case' record url contains a histkey which seems to be dynamic.. so I omitted it. Is that something mandatory in the url?

    Thanks.

  • anilambadan Profile Picture
    anilambadan 1,160 on at
    RE: clone record

    Please try to compare the url of the new record when you are clicking on 'Add new Case' and the one from the clone record link.

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: clone record

    Yes, I've done mapping. When I click the 'Add new Case' from the associated view.. it opens a new form with mapped fields. But the url from web resource is opening a blank form.

  • anilambadan Profile Picture
    anilambadan 1,160 on at
    RE: clone record

    Have you  done the field mapping as per the link? Data will be copied through the mappings.

  • Mahendar Pal Profile Picture
    Mahendar Pal 45,095 on at
    RE: clone record

    Data will be passed based on the self relationship and mapping that you might have created ?? based on the post. Have you done mapping ???

  • crmprogrammer2013 Profile Picture
    crmprogrammer2013 2,665 on at
    RE: clone record

    Okay thanks. But a blank form gets opened when 'Clone' button is clicked.

    I gave the etn as incident and createformId as the id of the parent record using Xrm.Page.data.entity.getId()

    This is the url:

    serverUrl+"/main.aspx?etn=incident&extraqs=%3f_CreateFromId="+id+"&pagetype=entityrecord", "_blank", features, false

    I don't understand how the field's data is passed through this url! Please help me.

    Thanks.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans