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

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Create Entity from Entity Template

(0) ShareShare
ReportReport
Posted on by

Almost all weird up...wanted thoughts or suggestions out there on how to create an entity from another entity that is acting like a template?

I am not familiar with Entity.Extensions.Clone to know if this is best used?
https://msdn.microsoft.com/en-us/library/microsoft.xrm.client.entityextensions.clone.aspx

Basically I have an entity acting like a template and when a subject is selected on Case create it calls out to this template entity and if the subject matches it creates new or clone entity of it and ties it to GUID of the case.

Makes sense?

Thoughts?

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Community Member Profile Picture
    on at
    RE: Create Entity from Entity Template

    Never mind saw my mistake

    customEntity["dew_incidentid"] = new EntityReference("incident", caseEntity.Id);

  • Community Member Profile Picture
    on at
    RE: Create Entity from Entity Template

    Good example but I decided to update an entity instead BUT

    that entity has a lookup field I am having problems populating.  It is a lookup field to Incident and while it is not erroring it is not doing much more.

    Sample code:

    customEntity["dew_incidentid"] = caseEntity.Id.ToString();

    String to string seems to work just fine for the name is there a special way to assign to a Lookup field?

  • Suggested answer
    Aileen Gusni Profile Picture
    44,524 on at
    RE: Create Entity from Entity Template

    Paul,

    I tried to find it.

    I can only find this article..

    This is an example how to use the entityextensions.clone

    social.technet.microsoft.com/.../14688.mscrm-2011-c-clone-closed-activity.aspx

    Hope this can help you.

    Thank you.

  • Community Member Profile Picture
    on at
    RE: Create Entity from Entity Template

    Change of plans, I'm going to build another entity that matches by attributes the same as the entity template then just update that entity with the attribute values.

  • Community Member Profile Picture
    on at
    RE: Create Entity from Entity Template

    Jimena I just looked at that link and I have come across that before and it isn't the direction I am trying to go.

    I want it to automatically create a clone but be separate from the entity template and be tied to the case via GUID.

    Probably only makes sense in my heard but it's there!

  • Community Member Profile Picture
    on at
    RE: Create Entity from Entity Template

    @benhosk Give it a go?! :)

    Thanks for both your input as I am now onto this part of the request.  I have filtered from the custom entity only those that match the subject from the case and now need to clone it and tie it to the case.

  • Community Member Profile Picture
    on at
    RE: Create Entity from Entity Template

    Hi Paul,

    Also I you want to clone a record in Dynamics CRM ONLINE, you can review this useful link:

    + How to clone a record in Dynamics CRM 2013? | http://dipankarbhattacharya.com/2014/02/19/cloning-a-record-in-dynamics-crm-2013/

    Let me know if this link is useful for you.

    Best Regards,

  • Hosk Profile Picture
    on at
    RE: Create Entity from Entity Template

    When you say you want to create an entity from an entity.  I assume these are the same types of entity?

    The clone method would probably work.

    give it a go

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…

Andrés Arias – Community Spotlight

We are honored to recognize Andrés Arias as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
Community Member Profile Picture

Community Member 2

#2
Christoph Pock Profile Picture

Christoph Pock 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans