Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics CRM (Archived)

Identity customization in CRM 2013

Posted on by 1,771

Hi,

I have unique reference number customization in CRM 2011.  Unique reference number will be created for each opportunity when save opportunity.  I did the following to achieve this functionality.  

1. Add new field called New_referenceNo  in opportunity form as shown in second picture.

2. Change filed property of New_referenceNo of table OpportunityExtensionBase in sql server as shown in below screen.

Allow Nulls No, Change Identity Specification to Yes ,Increment 1, Identity Seed 1.

4760.ref1.png

3 When save first time SQL will give the next sequence number to the opportunity in table and will update in reference Number.

ref2.png

Since in CRM 2013 OpportunityExtensionBase and OpportunityBase merged into OpportunityBase table Kindly help me to do the same in CRM 2013.

I did the following to get this but it is giving error.  Please find the details.

Run the script to change Allow Null option to No

 ALTER TABLE OpportunityBase ALTER COLUMN New_referenceNo int NOT NULL

Change filed property of New_referenceNo of table OpportunityBase by design  - right click on table

Change Identity Specification to Yes ,Increment 1, Identity Seed 1.

But I am getting the below error when save opportunity.

Unhandled Exception: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=6.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]]: Generic SQL error.Detail:
<OrganizationServiceFault xmlns:i="www.w3.org/.../XMLSchema-instance" xmlns="schemas.microsoft.com/.../Contracts">
  <ErrorCode>-2147204784</ErrorCode>
  <ErrorDetails xmlns:d2p1="schemas.datacontract.org/.../System.Collections.Generic" />
  <Message>Generic SQL error.</Message>
  <Timestamp>2017-03-06T05:07:52.1418066Z</Timestamp>
  <InnerFault i:nil="true" />
  <TraceText i:nil="true" />
</OrganizationServiceFault>

*This post is locked for comments

  • Suggested answer
    Rajkumar Rajaraman Profile Picture
    Rajkumar Rajaraman 18,108 on at
  • P NOUSHAD Profile Picture
    P NOUSHAD 1,771 on at
    RE: Identity customization in CRM 2013

    Hi,

    Thanks for your support.  I could find many solution for this but I do not know which one will be guaranteed one.  Kindly provide site or link the one you are familiar.

    Regards,

    Noushad

  • Suggested answer
    Wayne Walton Profile Picture
    Wayne Walton 13,726 on at
    RE: Identity customization in CRM 2013

    There are many supported autonumbering solutions for Dynamics CRM.  I strongly suggest you use one of those as opposed to unsupported SQL changes that can break.

  • Suggested answer
    jlattimer Profile Picture
    jlattimer 24,558 on at
    RE: Identity customization in CRM 2013

    Altering the database directly isn't supported. You should consider looking for a supported auto-number solution. There are several ISVs that provide them and plenty of code on the web.

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