function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
kingsixkingsix 

Special Auto Number

Hello,

 

I want to do the special  auto number for the quote.

 

Our opportunity's number is S0001, S0002, S0003................... something like this.

 

If the opportunity number is S0001, its quote auto number should be S0001-1, S0001-2, S0001-3

 

If the opportunity number is S0002, its quote auto number should be S0002-1, S0002-2, S0003-3

 

How can I do the quote auto number like this? Should I write some trigger?

 

Thanks for the help.

Best Answer chosen by Admin (Salesforce Developers) 
Ritesh AswaneyRitesh Aswaney

since Opp-Quote is master-detail, you could have a rollup on opportunity, which counts the number of quotes.

 

if you dont need to use the default name field on quote, then you can make it a formula field. else a workflow field update is also possible.

Opportunity.Name + '-' + Opportunity.QuoteCount__c

All Answers

Ritesh AswaneyRitesh Aswaney

since Opp-Quote is master-detail, you could have a rollup on opportunity, which counts the number of quotes.

 

if you dont need to use the default name field on quote, then you can make it a formula field. else a workflow field update is also possible.

Opportunity.Name + '-' + Opportunity.QuoteCount__c

This was selected as the best answer
kingsixkingsix

Thanks, it works.