You need to sign in to do that
Don't have an account?
Anonymous Developer
Question about List View
Hello Good day everyone I have a question about the list
I have a custom object application that has two lookup fields for accounts and has multiple related contacts on each account I want to filter all the records on the custom objects to only show the records to the contacts related to the accounts is this possible to implement if so can anyone help me?
Thanks in advance
Yes, it is possible to implement this filtering on your custom object records. Here is an example approach you could use:
Start by querying the related contacts for the accounts , You can use a SOQL query to retrieve the Contact records related to your Account records.
Once you have the related contacts, you can create a Set or List to store the Contact Ids.
Next, you can use a SOQL query on your custom object to filter the records based on the Contact Ids you retrieved .
Please try with below code :
If this helps , please mark this as Best Answer !
Thank you.
All Answers
Yes, it is possible to implement this filtering on your custom object records. Here is an example approach you could use:
Start by querying the related contacts for the accounts , You can use a SOQL query to retrieve the Contact records related to your Account records.
Once you have the related contacts, you can create a Set or List to store the Contact Ids.
Next, you can use a SOQL query on your custom object to filter the records based on the Contact Ids you retrieved .
Please try with below code :
If this helps , please mark this as Best Answer !
Thank you.