autopopulate more than one fileds using relate field

i have to module leads and accounts.i have set relationship one to many between accounts and leads. now i get a relate field in leads module,
now problem it when i choose account i want to populate more than one fields of account module as far as it choose accounts name

please help

Hi there,

You would need a many-to-many relationship. This would mean you could select many accounts using a sub-panel on leads.

The flex-relate field will only ever contain 1 account.



Will… thanks for the response… but what I think @arpit is asking is for the ability to populate other fields (like address, phone, whatever) from the linked account into the lead.

I am assuming this requires some custom coding, but I’m watching this threat to find out!

Hi sieberta,
You are very correct ,same thing you mentioned i want. Can you help me to achieve this


It isn’t elegant… but the only way I would know to do this is via workflow. So basically after a new record is saved in leads you run a workflow that sets certain fields in the leads module equal to certain fields from the accounts module.

I want to do that too, but I want to be able to concatenate some strings together into the field in the new record. And that answer I got was “that is custom code”. It would be nice if the AOW module could process PHP in the value field…


1 Like

thanks sieberta for your reply,But i think i also not work i need certain customized code or hint of idea so i can implement the same for the issue

Thank you Sieberta,
did you succeeded to concatenate any fields together?

no i ask to the customer for change request

What you are asking can be done by changing metadata of the relate field in the editviewdefs for the Leads module.

Hi eitrix,

I already find this file but i required the code or idea to achive this .


I haven’t tried any further yet… what I’m going to try and do is figure out a way to allow workflow to process some PHP or SQL through designating that it is code, not a constant, somehow. I haven’t had time to look into this, but it seems like it would be possible. I have no clue, however, how to make it upgrade safe, or even where to find documentation on what is and is no upgrade safe.

Well, even if it’s not elegant using the workflow to populate a field I would be happy with that but unfortunately I can’t do it. I would like to populate a quotes field with an accounts field but when defining the actions I just can’t select any accounts field, only quotes fields are available in the dropdown list and by the way I cannot change the module from which the filling field will be selected.

Maybe I missed something ?

Nope, you’re right. You can affect two different tables through the use of the “Add Relationship” button at the bottom of the Workflow Actions table, but it is the wrong direction for you. It would allow you to change something about the account record rather than the quotes record. (This is assuming, of course, a relationship exists between the account and the quote).

This is going to present an issue for me also, as my goal was the same as yours… I wanted to change the name of my “Vacations” record based on the “Full Name” of the User to which it was related.

I have no solution for you… someone is going to either have to write code to solve this. Either modify AOW, or possibly just write a “trigger” in MySQL to resolve the issue… or create custom PHP that does this after being called by the scheduler the same way workflow would.

Hmmm… you’re making me realize that AOW is really going to fall short of the target for me too in a lot of things I wished to do with my vacation module… frankly rendering my vacation module useless unless I write significant code to support it.

Maybe someone more experience on here has better ideas!


Can you expand on how we would accomplish this. Or perhaps point us to some documentations on the editviewdefs?


To make this topic just a bit more complete, I would like to point out that, in some cases, Logic Hooks will do the the job. one is looking for. If you google Sugar Logic Hooks, you’ll find good information.


AOW is great but its very simple, and doesnt provide much flexibility.

I would also like the ability to use FlexRelate fields with custom modules. As I only use custom ones not the standard ones.

Okay the queries on the dropdown when Add Relationship / Field under the Create Record dont work, when inserting the workflow record it selects what appears to be the relationship table as described above, but once saved and you go back in, it then displays the fields from the workflow trigger module. It does NOT include the fields or the ID from the created record element, which it should do if you want to add the relationship properly to multiple tables.