You need to sign in to do that
Don't have an account?
MikeCloud
Auto populate account lookup field on custom object
I have a custom object with contact lookup field and account lookup field, when I enter Contact I want Account lookup field to populate based on the contact (associated to only one account) to cut down on all the lookups my users need to do in this object page layout.
Write a trigger to after insert to update the account lookup field to update with the account id of the populated contact id
you can do this by queryin the accouintID field from the contact and populate it on the related account field and update record.
you want something like this. note the active__c field is just a yes/no picklist and is used for demo purposes. your trigger would just swap out this active__c field for the account lookup fields