Auto Naming Quotes Based on the Deal Name - Zoho CRM - Zoho Deluge


I just discovered this website and Paul Nicholson! Not sure if this is right place to post this, but I am in the process of learning Deluge but very much a beginner.

I think what I am trying to do would be very simple for an experience Deluge programmer.

I simple want to name the quotes (the subject field) generated from the parent Deal name. But as each quote is created, I’d like them to be incrementally added the next letter in the alphabet.

So is Deal Name was: REF6475

Then Quote 1 would be called REF6475-A
And Quote 2 would be called REF6475-B

I have managed to get the first part working (REF6475) with a very simple function called from a workflow, that simply copies the Deal Name to the Subject field. But I haven’t yet worked out how to add the letters!

As I said, not sure if this is right place. If not forgive me.

But I am happy to have found this haven for Zoho One as I am a big fan. :smiley:

Cheers, Leigh

Welcome @le1ghp

Totally right place.

Join the club haha.

Let me see if the Zoho Geeks can come up with the code to do this for you may aswell go to the geeks.

Here’s the theory - Code incoming.

Firstly create the quote record and fetch the deal name via the deal lookup field. Then, use the getRelatedRecords function and search the already available quotes. In Deals module, you have quote related record. Now, if the created quote is first record for the deal, then user A, if it is already there, you can add the respective letter.

In order to get the correct alphabet, use a list which contains the alphabets. Thus, with the list functions, you can get the respective alphabets

1 Like

Here’s the code @le1ghp let me know if it makes sense.

Alphabets = {“A”,“B”,“C”,“D”,“E”,“F”,“G”,“H”,“I”,“J”,“K”,“L”,“M”,“N”,“O”,“P”,“Q”,“R”,“S”,“T”,“U”,“V”,“W”,“X”,“Y”,“Z”};
resp = zoho.crm.getRecordById(“Quotes”,id);
dealid = resp.get(“Deal_Name”).get(“id”);
dealname = resp.get(“Deal_Name”).get(“name”);
related = zoho.crm.getRelatedRecords(“Quotes”,“Deals”,dealid);
size = related.size();
info size;

if(size == 0)
sub = dealname + " - " + Alphabets.get(0);


sub = dealname + " - " + Alphabets.get(size - 1);

mp = Map();
update = zoho.crm.updateRecord(“Quotes”,id,mp);
info update;

  1. Map id with the quote id in the edit arguments.
1 Like

Hey Paul! Thank you so much for this. I missed the notifications. I will try the code and let you know. how it goes! Glad to have found the right place. I hope I can give back to the community in 2022.


1 Like

You’re welcome!

Ah i need to check settings I never got notified on your reply either.