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.
3 When save first time SQL will give the next sequence number to the opportunity in table and will update in reference Number.
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