You need to sign in to do that
Don't have an account?
Laytro80
Auto populate a lookup
Hi,
I have a record which has both an account and a contact lookup.
If the contact lookup is populated I would like to automatically pull through the account name the contact is linked to.
Is this possible, maybe using an APEX trigger to fire when the record is saved?
Any tips would be appreciated very new to APEX development.
Thanks
Ross
If you just want to display the account name, you can use a formula field for that. Otherwise, for sure you can use an apex class/method to set accountid on your custom object.
Thanks for the post. Use the formula method first off but the users need to be able to have records just assigned to the contact level. They just don't seem to happy about having to looking a contact and then the contacts account. Even though they want the record displayed against both.
I very new to APEX code, any one have some pointers on this type of trigger.
Ideally I would like the account field to populate if and as soon as someone enters a contact.
But I think I will need to create and APEX trigger that fires after the records has been saved.
Thanks
Ross
Have you tried doing a field update from the workflow?
The fields are not available in the field update workflow.
I suspect I cannot change a account or contact lookup that way.
Looks like an Apex trigger is the only solution so I will have to do some reading!
Thanks for trying to help.