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)

cloning record using plugin Microsoft.Xrm.Client clone()

(0) ShareShare
ReportReport
Posted on by 645

Hey

I searched the net for a way to clone a record using plugin, I found out that the lib -  Microsoft.Xrm.Client has the clone function, there are many options to clone a record but I need a wide example of using the clone function(of Microsoft.Xrm.Client) or explanation.

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Shaminderpal Singh Profile Picture
    1,565 on at

    Hi sahara,

    This dll was used to connect to crm in full trust till version 2016.You will not able to register plugin using this dll and from d365 it is not even present in sdk.

    You can clone your record by getting the fields and substituing them to new entity object in and invoking create request then.

    Hope it helps.

    -Shaminder

  • sahara Profile Picture
    645 on at

    Hey Shaninderpal

    I asked if Microsoft.Xrm.Client is supported  in crm 2016 on this forum and I got an answer that it's supported... so I'm a little confused now... what do you think is the best way to clone using plugin ?

  • Verified answer
    Shaminderpal Singh Profile Picture
    1,565 on at

    Hi sahara,

    Its a valid dll for crm 2016 however its prime purpose was to establish a connection to crm and get the org service object.

    Since you want to have your logic in plugin we dont need this dll as connection is already handled by native plugin code and we get the org service object from service provider itself.Moreover this dll requires full trust to run and if you are having crm online which runs plugin in sandbox you will not be able to register it unless you bind it using ILMerge and stuff.

    Related to cloning,on which action you want to clone plugin ,i mean (create/update)

    If you want it to be user initiated process,create a ribbon button and on click of it,call an action(bounded) .On this action,use create message and map the fields from your current record to it using wf editor itself.

    If it needs to be a dynamic operation means triggered from your code rather than user action  ,then you need to retrieve the fields and create a new entity object and substitute them.

    I created a similar protype for the user initiated actions in one of my previous projects using oob actions and js.

    -Shaminder

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