You need to sign in to do that
Don't have an account?
sfdc_newbie17
Passing multiple id's in parameter for a SOQL query
Hi all
Very new to apex development but looking to pass through multiple known id's to a custom VF page to return details of accounts details.
Is this possible and does anyone have any examples.
Thanks in advance
Very new to apex development but looking to pass through multiple known id's to a custom VF page to return details of accounts details.
Is this possible and does anyone have any examples.
Thanks in advance
Yes, it is possible to pass multiple IDs to a custom Visualforce page to return details of accounts. You can do this by using the ids parameter in the page's URL. The ids parameter should be a comma-separated list of account IDs. For example, the following URL would pass the IDs of accounts 0012345678901234, 0012345678901235, and 0012345678901236 to the page:
Once the page has received the IDs, you can use them to query the Account object. For example, the following code would query the Account object for all accounts with the IDs that were passed to the page: Here is an example of a custom Visualforce page that can be used to display the details of accounts that have been passed to the page:
Controller class
If this information helps, please mark the answer as best. Thank you
All Answers
Yes, it is possible to pass multiple IDs to a custom Visualforce page to return details of accounts. You can do this by using the ids parameter in the page's URL. The ids parameter should be a comma-separated list of account IDs. For example, the following URL would pass the IDs of accounts 0012345678901234, 0012345678901235, and 0012345678901236 to the page:
Once the page has received the IDs, you can use them to query the Account object. For example, the following code would query the Account object for all accounts with the IDs that were passed to the page: Here is an example of a custom Visualforce page that can be used to display the details of accounts that have been passed to the page:
Controller class
If this information helps, please mark the answer as best. Thank you
How would I go about writing a test class for this so I could migrate to production?