Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Suggested answer

Retrieve fields

Posted on by 25

Hi All,

I have two feilds named address1_longitude and address1_latitude in account.

On change of inherit(Boolean in contact form) I need to copy the values of above mentioned 2 fields into contact which are on the form.

Please help me how to achieve this requirement.

  • Suggested answer
    Ran Zhang Profile Picture
    Ran Zhang on at
    RE: Retrieve fields

    Hi Kruthi,

    I believe it can be achieved by JS as long as we can retireve the fields on form.

    Below are some web API useful:

    Xrm.WebApi.retrieveRecord(entityLogicalName, id, options).then(successCallback, errorCallback); which returns a promise containing a JSON object with the retrieved columns and their values. Details please refer to https://docs.microsoft.com/en-us/powerapps/developer/model-driven-apps/clientapi/reference/xrm-webapi/retrieverecord#syntax.

    Once you get Account attributes, then use this API to create a new record:

    Xrm.WebApi.createRecord(entityLogicalName, data).then(successCallback, errorCallback);

    You can also construct REST web api to do these as well. Some reference articles:

        

        

  • empath-e CRM Profile Picture
    empath-e CRM 1,134 on at
    RE: Retrieve fields

    Sorry I'm not a coder so I cant help with that I'm afraid. Any reason why you prefer coding this change as opposed to using the standard functionality? Just interested for my own knowledge.

  • Kruthi2704 Profile Picture
    Kruthi2704 25 on at
    RE: Retrieve fields

    Hi Adam

    Thanks for the answer but I am looking for javascript would be great if you can share the code

  • empath-e CRM Profile Picture
    empath-e CRM 1,134 on at
    RE: Retrieve fields

    Hi,

    You can create a Workflow to achieve this on the Contact entity. Set the Record fields change to fire on your Contact Boolean field. If Boolean equals "Yes" copy Account  address1_longitude and address1_latitude into Contact address1_longitude and address1_latitude

    I hope this helps.

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 Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans