web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
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

I have the same question (0)
  • Verified answer
    Mahendar Pal Profile Picture
    45,095 on at

    Hello,

    etc= It's entity code, that can change based on the number of entity while deploying your solution from one environment to another, so instead of etc you should use etn which means entity name so for example account it will be etn=account

    And it seems _CreateFromId = Is the source record id, that you want to clone.

    Thanks

  • crmprogrammer2013 Profile Picture
    2,665 on at

    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.

  • Mahendar Pal Profile Picture
    45,095 on at

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

  • anilambadan Profile Picture
    1,160 on at

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

  • crmprogrammer2013 Profile Picture
    2,665 on at

    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
    1,160 on at

    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
    2,665 on at

    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
    1,160 on at

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

  • Aileen Gusni Profile Picture
    44,524 on at

    Roxanna,

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

    Thanks

  • crmprogrammer2013 Profile Picture
    2,665 on at

    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.

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans