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 :
Customer experience | Sales, Customer Insights,...
Answered

Working with ribbon workbench in order to copy contact entity fields data to case entity field, how can i achieve this.

(0) ShareShare
ReportReport
Posted on by 342

i have a requirement in order to copy contact entity fields data, concatenate both the contact fields  data in to one and copy the data to the case entity field, how can i achieve this, i have created button "new case" on contact form using ribbon work bench,  when i click on new case button automatically the data to copied into case form, i am facing issue in writing java script web resource to achieve this functionality

I have the same question (0)
  • Ran Zhang Profile Picture
    on at

    Hi Sandy,

    It seemes to be achievable and I think the most difficult part is to identify which Lead record copied to. Otherwise, we don't know how to code. Do you want to copy data to Contact originating Lead? If yes, then it would be much easier. I am providing below suggestions, hoping they can be of help.

    1.We can easily achieve this with workflow registered on Contact. You may create a on-demand workflow which executes when clicking on Flow -> Run Workflow.

    In the step, choose update a record(Case). Then set properties.

    pastedimage1600917996512v1.png

    2.Customize button and execute JS function.

    1) We should first retrieve the field value and the leadId of a contact.

    var lead = Xrm.Page.getAttributes("_originatingleadid_value").getvalue();
    if(lead != null){
    var leadId = lead[0].id;
    var leadName = lead[0].name;
    console.log("leadId = " + leadId);
    console.log("leadName = " + leadName);
    }

    References:

    https://docs.microsoft.com/en-us/dynamics365/customer-engagement/web-api/contact?view=dynamics-ce-odata-9

    https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/303261/how-to-get-field-values-from-a-lookup-field-entity

    2) Update the Lead record, referring to https://community.dynamics.com/crm/f/microsoft-dynamics-crm-forum/239022/update-a-record-using-web-api

    Hope above helps.

  • Ran Zhang Profile Picture
    on at

    Sorry for a typo.

    Xrm.Page.getAttributes

    should be Xrm.Page.getAttribute.

  • Verified answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hi,

    Please see below article to achieve what you are looking for.

    docs.microsoft.com/.../set-field-values-using-parameters-passed-form

    Please mark my answer verified if i were helpful

  • Sandy Hello Profile Picture
    342 on at

    Thanks Bipin for your response, this helped me a lot

  • Suggested answer
    Bipin D365 Profile Picture
    28,983 Moderator on at

    Hello,

    I am glad that it solved your issue.

    Please mark my answer verified to close this thread.

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 > Customer experience | Sales, Customer Insights, CRM

#1
Tom_Gioielli Profile Picture

Tom_Gioielli 170 Super User 2025 Season 2

#2
#ManoVerse Profile Picture

#ManoVerse 61

#3
Gerardo Rentería García Profile Picture

Gerardo Rentería Ga... 52 Most Valuable Professional

Last 30 days Overall leaderboard

Product updates

Dynamics 365 release plans