Hi Dane,
@nickdeckerdevs gives you a great description of using custom code with HubDB to create an incrementing number. Although he mentions Invoice a few times, it’s equally applicable to Quotes.
But as some additional tips, there are caveats to beware of regarding Quotes:
1. Custom properties are not searchable
2. Quotes are often cloned
3. Published quotes cannot be edited.
We wrote an app called DoQuote to solve a range of Quote-related issues in HubSpot Quotes. One of the simplest things it does is add a incrementing quote number, like Q00123. I’m not suggesting you need DoQuotes, but from our developing it, we learned a few tips that you should find useful if you code the workflow actions as Nick suggests:
If possible , write your code to “pre-pend” the quote number to the start of the quote name. So if the quote is “ABC Company - New deal”, write your code to edit the name to “Q000123 - ABC Company - New Deal”
It makes the quote number visible and searchable so that sales reps can see multiple quotes on the deal, and easily talk with the customer about Quote 123.
In your workflow that assigns the number, also check if the deal name starts with “Qxxxxx -”. If not, pre-pend it. (and always store the quote number in a custom property too, like Nick suggests, especially for the next part - de dupe)
Secondly, if sales reps clone a quote, you will have a duplicate quote number. So this is more complex to solve. Write your code to pull a search request, to see if more than one quote record is returned with the same quote number. If so, generate a new quote number and update the new quote name and property with the new unique quote number, so you don’t have duplicate quote numbers.
Finally - beware if the quote is published. You need your workflow to run and to set the quote number before the quote is published. Once published, a quote cannot be edited - so check for that status and set a task to rectify the quote number. This is not super elegant which is why we ended up writing an app, but hopefully it’s rare if your users are aware to not publish the quote until it has a quote number in the title.
I hope this helps!
best
Pete