Automatically assign User to Contact or Lead or Meeting depending on dropdown list value

Hi Everyone,

I’m newbie to suiteCrm and i need some advice.

I added a “postal code” field to the “meeting” module. this field will perhaps be a free text field, or perhaps a dynamic drop-down list with also a choice of the region (also a drop-down list) which will filter the list of postal codes, whatever

For example we have the values 1,2,3,4 as postal codes, and Bob, Alan and Tim as already existing users
The postal code 1 should be attributed to Bob
2 to Alan
and 3 & 4 to Tim
automatically when editing a new meeting (in ajax ?) or at least when saving the meeting form

I have already searched in almost all subjects with the terms “dropdown” or “assign” and I can not find a case corresponding to this one
thank you very much for your help

Hi @nicopoal,

Welcome to the Community! :tada:

I see two simple options for you here. Which one you choose depends on ability when It comes to coding. If you have dev experience I would say go with suggestion 2 for higher reliability and more freedom in your conditions and response.


Suggestions 1. Workflow

Create a workflow per user which you wish to be included within the auto-assign system and set the params as follows;

  • Module: Meetings

  • Run: Only on Save

  • Run On: Modified Records

  • Conditions;

    • Postal Code: 1
  • Action;

    • Assigned to: Related User

You would need a workflow for each of your options in the drop-down unless in cases like Tim you could use conditions 3 Or 4


Suggestion 2. Logic Hooks

For more info on Logic Hooks see the dev guide here


Let me know if you have any further questions!

Thanks,
Mac

Hi, @Mac-Rae,

Thank you for your fast answer and for your warm welcome.

in fact I was PHP developer for several years, but very beginner on suiteCRM, I browsed a few documentation but I still do not know exactly where to start and good practice to add a hook, use beans or to add a page custom, or how to add a custom dashlets … but that will be for future questions on other subjects :slight_smile:

I think I will try first with the workflow, and then with some code, if you have examples that look like my questions I am interested :slight_smile:

Thank you very much again, have a nice day :slight_smile:

Nico

This thread although a bit confusing maybe a good read as it covers a few debugging steps however this specific comment #19 has some interesting links that are worth checking out;

Im sure if you search around on the forums for logic hooks you’ll find plenty others also.

The best idea would be to create the workflows and once you have your functionality try to replicate them with code.

Let me know if you have any issues and I can tag some people more knowledgeable in this area :+1:

1 Like

@nicopoal
In addition to @Mac-Rae
If you want take the postal code from Contact to Meeting on front, it’s easy. Look at the post. It’s work without problems with text field. You can make the hidden text field and add small script for select match in field which type ‘selected’.

1 Like

Hi @p.konetskiy, thank you for your help.

your link can help me, but not necessarily in this case (I think).
Let me explain: in fact the need is to create appointments files with the “meeting” module and to automatically link with a user, according to a postal code entered. These users are in fact the company’s sales representatives and work in one or more geographic areas. The postal code - user correspondence is defined in advance and will not be changed often.

On the other hand your link may interest me because I will also have to link the meeting to a contact (or a lead) and I would like to display certain information of the contact (phone, mail, city) also in the meeting, it can avoid me to duplicate this information :smiley: so i’m gonna take your info very seriously too, thank you !

(sorry for my bad English, I’m French and I use google translate a little bit :-D)

Hi, @nicopoal

English is not my native language too.
I want to clarify the details. You write: “create appointments files” . Do you realy wrote about files? I don’t understand, how do “automatically link with a user” from file? May be fields?

For fields you can use filters when open popup window. It’s may be useful when you have few users with one postal code.

P.S. Sorry for my English too.

hi @p.konetskiy,
yes it’s a translation mistake (thank you google translate ahah)
what i wanted to say is : create “rendez-vous” using the meetings module, it’s not about “files” , sorry :slight_smile:

the goal is to assign this meeting to a user by selecting a postal code. I have the list of users, and the postal codes linked to each of them

i will soon try with the workflow and post screenshots here later :slight_smile:

1 Like

Hi, everyone.

So, i just do what i wanted with workflow and it’s pretty cool :slight_smile: I’ll put hands in code later , with custom dashlets i’ll have to build :slight_smile:

Thank you very much for your help :smiley:

2 Likes