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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Update field by using odata and Json scripts

(0) ShareShare
ReportReport
Posted on by 1,821

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

I have the same question (0)
  • Suggested answer
    Gopalan Bhuvanesh Profile Picture
    11,401 on at

    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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans