You need to sign in to do that
Don't have an account?
Saie Shendage 7
how to create a salesforce report when a field is multi select picklist using apex class?
I have to show a report on account object where reason is a multi select picklist. Suppost fot Account 1, if reasons selected are A;B;C,
then the repost should be generated like :
Account Number | Reason
Account 1 | A
Account 1 | B
Account 1 | C
Please help with the answer if anyone knows
then the repost should be generated like :
Account Number | Reason
Account 1 | A
Account 1 | B
Account 1 | C
Please help with the answer if anyone knows
We went through your query and it seems like that it is not currently possible to report data related to a single selection within a Multi-Select Picklist field. Please also see this link: https://help.salesforce.com/s/articleView?id=000326275&type=1 (https://help.salesforce.com/s/articleView?id=000326275&type=1)
But there are a couple of workarounds that can help you achieve this.
- Solution 1: You can create an aura/lightning web component and display that on the Record Detail/Home page. In that component you can create the columns as per your requirement, you can loop through the reasons and display the other account information as is.
- Solution 2: You can create a new custom object which will contain multiple records for the account, each having an account Id and a single reason. But you need to maintain records in that object based on the selected/unselected reasons in an account record. After that you can create a custom report type on the new custom object and account object, and display it on the report. For example: for Account 1, reasons(A;B;C), you need to create 3 new records(one for each reason) in the new object. Each custom object record will have a lookup field with the Account object, and one reason.
Custom Object Name | Account | Reason
1 | Account 1 | A
2 | Account 1 | B
3 | Account 1 | C
Now in the report of the Custom Object we can group it by the Account Lookup field, which can make the report look like what you want.