Create a custom naming series for Quotation

Hello,

I want to include the customer id in the quotation series, but I could not find a documentation where explains that. I have only found the video where it is explained, but I think that video is useless because only it consideres the “happy” case.

I want something like this:

QTN-.YY.customer.####

On the other hand, is there a good doc where list all fields that can be used in naming series?

Regards
Jaime

You should be able to use any of the fields in the document. You can add custom ones in Naming Series after selecting the document. Also, Naming Series has a decent help text to guide you.

@akurungadam

I don’t know what you call “decent”. This page “Naming Series”? it only tells what can be done, but it does not explain how it can be done. It only show this example: PO-.YY.MM.-.vendor_id.-.#####… that way, I can guess that YY and MM are years and month respectively. Or maybe you are referring to other doc.

Well, when you write “any of the fields in the document”, do you mean the custom form for doc type? Using again the example above, I have loaded custom form for Supplier doctype and I have not seen “vendor_id” as the field, so maybe that field is in other page.

Can you explain me further, please?

Thanks
Jaime

any of the fields of the doctype - in your case quotation

I need to add the ID of customer as a hidden field, and of course, no doc on this.

I tried creating a new field, I marked it as hidden. But I need to know in what field I can specify where the customer id should come from.

Maybe in “Options” text area? I think I have to include the table field there, but, what is the name of customer id field?

By google’ing, I have found nothing but questions in this forum, about not exactly what I need.

Jaime

Please check this documentation on how to add custom fields.

https://erpnext.com/docs/user/manual/en/customize-erpnext/custom-field

You can use fetch from to fetch fields from linked Customer document. But in your case if you are managing Customer naming by naming series, you can use the link field itself.

Customer is already present and the type is “Link”. So, if I add “customer” in the naming series, automatically the ID will be added when I do a quotation?

And if I use Fetch From, I don’t know how the field is called in database.

Regards
Jaime

I guess, yes! Whatever in the link filed should be added to naming series. Please try.

BTW, you can Menu > Customize to see field names

Hi.

A quick tip is to go into the form and click Menu and then customize and scroll down to the fields. Label is the text displayed on the form and the Name is what you need.

So for quotes

  1. Go to Setup>Naming Series
  2. Select Transaction = Quotation
  3. Scroll down Series List for this Transaction and the following should be displayed:
    SAL-QTN-.YYYY.-

Change this to:
SAL-QTN-.YYYY.Customer-

You can add #### if you want four digits at the end.

  1. Click Update and your good to go.

@akurungadam You pipped me to the post! :slight_smile:

1 Like

In fact, I was trying to pip him to look around and figure it out

:grinning:

The documentation is pretty good and does explain things well.

There are a few things missing which I’m struggling with and then there’s the whole backup/restore and creating an app to store customised fields in case upgrades fail which isn’t well documented… however the forum is great for that!

1 Like

Hello, I wanted to be sure since this is production server… I did what you suggested, but do you want to see how it becomes?

This way: QTN-19customer0049

Now. please tell me how to correct that number. I think I should to it in database.

regards
Jaime

Hi.

Sorry, but always try ALL changes in your test system before updating your production server! Safety first!

Great so your quote reference now has the customer id on it? To reset the numbers, go back to the naming series, select Quotation and then scroll down to Update Series section and change the number to the start number and click “Update Series Button”.

Thanks.

Thanks.

I have no test system. It was a real pain to install it in production… fortunately this is my own company so I don’t need to give explanations to anybody, but I want to do things right in order to manage the company well.

“Great so your quote reference now has the customer id on it?” → please, tell me where the customer id is.

I repeat the real quotation number that resulted:

QTN-19customer0049

I am wondering if you see the “customer” text inside it.

Regards
Jaime

Hi.

Sorry this was driving me crazy. Just tried all sorts of things and eventually its working.

To add the customer simply put .customer, i.e. you need the period.

So for example:

SAL-QTN-.YYYY.-

Will give you SAL-QTN-2019-00001

SAL-QTN-.YYYY.customer.-

Will give you SAL-QTN-2019Customer1-00001

Don’t forget to reload the quotation screen for the changes to take affect.

Thanks.

Hello, but if I want just the id number, not the text “Customer”?

For example, SAL-QTN-2019-1-0001

Sorry, which id number are you referring to?

The id in the table… the identity, the serial, or the primary key of the database table.

But more importantly now… I have opened the database, table tabQuotation… the question is: if I modify the value of “name” field, that currently has QTN-19customer0049, may I corrupt something?

Regards
Jaime