Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Auto number in opportunity

Posted on by 1,771

Hi,

I have created  auto number entity as shown below screen. I want to do increment on  next number of auto number entity from opportunity form.

I used below script on opportunity form load event.  and add SDK.RES.js for CRM 2015 SDK.

0743.p51.png

But I am getting below error when I run the scripts

function Form_onload()
{

var new_autonumber = {};
new_autonumber.new_Opportunityrefnumber = 200;
SDK.REST.updateRecord("{90FA790A-362B-E711-80BF-00155D644B1B}", new_autonumber, "new_autonumber", updateSuccessCallback , errorHandler);

}

W51.png

*This post is locked for comments

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Auto number in opportunity

    If you are still looking for an auto number generator that support generation before the record is created via javascript, have a look at  Dynamics 365 Identifier Generator available from https://github.com/hncrm/HNIdentifierGenerator 

  • P NOUSHAD Profile Picture
    P NOUSHAD 1,771 on at
    RE: Auto number in opportunity

    Hi ,

    I am planning  by java scripts.

    1. Odata and Json  for retrieving next auto number from Custom auto number entity

    1. sdk.rest.updaterecord to increase and update next number in Custom auto number entity.

    I could n't  find any refrence on custom entity auto number by java script on the link provided.

    Please provide the details what is issue if we go by java scripts.  Workflow or java script. which one is good solution.

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Auto number in opportunity

    Hi Noushad,

    Refer the link below for auto numbering entities in dynamics CRM.

    www.encorebusiness.com/.../dynamics-crm-auto-number-entities

  • Suggested answer
    Nithya Gopinath Profile Picture
    Nithya Gopinath 17,074 on at
    RE: Auto number in opportunity

    Hi Noushad,

    Have you written the function called updateSuccessCallback ?

  • Suggested answer
    Gee Bee Profile Picture
    Gee Bee 11,397 on at
    RE: Auto number in opportunity

    Hi

    If you are trying to add custom auto number feature then JavaScript is not a preferred method.

    Please refer the following thread:

    https://community.dynamics.com/crm/f/117/t/113930

  • Suggested answer
    Gee Bee Profile Picture
    Gee Bee 11,397 on at
    RE: Auto number in opportunity

    Hi

    This error says that the function updateSuccessCallback  is not defined.

    You have to create another function called updateSuccessCallback.

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