In a custom object I have a look up for account. so once the account is selected from the account list the object will be somehow connected to the account. I need 2 fields in that custom object that will get information for the selected account.
I have my custom object called service review with following custom fieldsenter image description here:
We paid agency to do an app using enterprise soap API and based on that look up account it needs to get two fields. One of them is the Account Owner which is a look up user field. and the other one is contacts which is a list of contacts related to the Account. How can I dod this so that in the app once you create an object instance and look up the account it will give me the choice to look up contacts and auto populate user based on that account ? enter image description here enter image description here

  • Do you need to put Account.Owner and Account.Contacts in Service Review fields? For Account Owner you can create a formula field on your Service Review object but Contacts might return a list not a single value, what do you need to do with that list? – Oles Malkov Mar 24 '16 at 13:50
  • How would the formula look like for that ? I just need one contact from the contact list inside of that field. – Greg Mar 24 '16 at 14:02
  • For Acc owner it will look like ` Account.Owner.FirstName & " " & Account.Owner.LastName`. But you can't refer to Contacts field in a formula field. To populate that you will probably need a trigger. – Oles Malkov Mar 24 '16 at 14:48

Getting Account fields is very easy.
1)If you want these fields to be ReadOnly then use formaula fields.

AccountOwner - Client_Name__r.OwnerId

2) IF you want to make it editable use the workflow field update

Use the same formula for Field update.

Getting the contact data is tricky. Since one account can have may contacts which one you want to choose?

It need to be done via Apex trigger.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.