Auto populate account field in AOS_Quotes module

Hi everyone,

I try to make auto populate the billing_account field in the AOS_Quotes module when the relate field “Opportunity” is setting, so i follow this page:

But i have a problem i can only auto populate the field billing_account_id because i can’t get the name of the account with this trick. The name of the account isn’t store in the database, only the id is stored, so i can’t access at the name of the account.

I’ve try to set the name of the account with the same trick: when the field billing_account_id is set, we update the name, but that’s not working.

Here’s the code i use to auto populate the billing_account_id:
The vardef file:

The editviewdefs.php:

Can someone help me ? Or put me on the right way. Maybe i need to use javascript or jquery or another way.

Best regards.

do you know that this is done automatically if you create a Quote from the Opportunity it self? and why are you saying that the name of the account is not stored in the database?

best regards

Thank’s for your response.

Yes i know but i try to make it when we create the quote normally. I’m saying the account name is not stored in the database because he’s not stored in the opportunity table or in the quote table. I’m saying that because i can access only these fields.

Here’s my opportunity_cstm table :

We can see the field i use: account_id_c and no field named account_name_c .

Best regards

the account name it is stored in the database, just not in that table, there’s a relationship table between accounts and opportunities, let me test your code and will feedback to you.

best regards

Yes i know the account name is stored in the table account_opportunities. But it’s not exactly the name, it’s the id of the account with the id of the opportunity.
So, to have the account name maybe i need to do some database request, but in the files where i work, i can’t doing a database request.

Best regards.