Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Update field by using odata and Json scripts

Posted on by 1,771

Hi

I created new entity called Auto number.  I want to update opportunity ref number field of auto number entity inside opportunity form by using java script on save event.  I can bring this number in opportunity form by using below script (it is part of the script)

retrieveResult.setRequestHeader("Accept", "application/json");
            retrieveResult.setRequestHeader("Content-Type", "application/json; charset=utf-8");
            retrieveResult.send();
            if (retrieveResult.readyState == 4 )
               {
                if (retrieveResult.status == 200)
                   {
                    var retrieved = JSON.parse(retrieveResult.responseText).d;     

 

But I want to know how I can update the opportunity ref number of Auto number entity inside the opportunity form in save event.  Kindly provide the simple sample script to update field by using odata and json scripts.

Or how I can update Auto number entity inside the opportunity form in save event.

p60.png

*This post is locked for comments

  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    Gopalan Bhuvanesh 11,397 on at
    RE: Update field by using odata and Json scripts

    Hi

    Please refer the following for an example code using Web API:

    Create a similar function for AutoNumber entity

    function BasicUpdateAccount()

    and call the function

    function UpdateEntity

    [View:https://szuyublog.wordpress.com/2016/02/24/microsoft-dynamics-crm-2016-web-api-update-and-delete-entities/:750:50]

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,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans