Pages

Wednesday, January 6, 2021

Salesforce: Mass Close Case

Two years ago, I blog on using quick action to mass update a field from a list view, check out this blog. This blog is to use the same approach, but allow the user to enter data before doing the mass updates.

Use case: Universal Container would like to allow the Marketing team to do a mass close case, however, the user must enter a reason in a custom field before closing the case.

Inline editing support edit Status in the list view, however, the custom field for reason is a long text area field, which is not supported by inline editing, see this limitation here.

Solution: implement Quick action for List View

Note: I have seen many consultants customize this by using visualforce page and apex class which is not necessary and over-engineer, when click-not-code can achieve the same result and easier to maintain.


1. Create New Action

From the Setup menu, navigate to the Case object, look for the Buttons, Links, and Actions menu. Click the New Action button, enter/select the following values:


Add the custom field for reason and remove all other fields, make the field as required if necessary.



2. Add Predefined Field Values

Still in Mass Close Case action created, scroll down to Predefined Field Values section, then click the New button, enter the as below and save.



3. Add button to the layout

Stay in the Case object, click Search Layouts for Salesforce Classic menu, then click Edit under the arrow on List View. "Mass Close Case" should be available under "List View Actions in Lightning Experience"

Select the action and click the add arrow button.



4. Case tab

Click the Case tab, you need to select a view, except Recently Viewed. You should see the "Mass Close Case" button, you maybe need to click the arrow button to show the new button, if too many buttons added to the list view.


5. Select records

Select a list view, but not the default "Recently Viewed", then select multiple case records. Click the "Mass Close Case" button, you will be presented to enter a reason to close the case, this will update the Status and Internal Comments field for all Cases selected. Click the Save button, and then the OK button to confirm.



All Case Status updated to Closed and all "Internal Comments" with "PO created".

12 comments:

  1. Crate 2 new Predefined Field Values.

    ReplyDelete
  2. Thanks. Added to our client's org. Shared this post to the IdeaExchange.

    ReplyDelete
  3. How can we add for the console layout

    ReplyDelete
  4. The Case status does not seem to get updated after save. Anyone else seeing the same issue.

    ReplyDelete
    Replies
    1. can you close the same case manually? just to make sure no rules block case closure

      Delete
  5. Yes, I am able to close the case manually.

    ReplyDelete
  6. Yes I can, salesforce support was able to get this to work in their demo org but it does not work in my Full Sandbox or Developer org.

    ReplyDelete
    Replies
    1. good at least it work in their demo org, they should be able to found the issue with your org.

      Delete
  7. I had the same issue with Mass Close Case not changing the status of the cases to Closed. The button would work if I only selected one row, but it would not work with multiple rows. I had a validation rule on case closure to have some fields filled out.

    I found out the problem is the Predefined Field Value. If you default the status to Closed, it will not work. If you don't include this and manually select a Status of Closed after clicking the Mass Close Case button, then it successfully closes all cases. This solution also follows any validation rules.

    ReplyDelete
    Replies
    1. I was also facing the same issue, I followed your comment and it worked now . Thank you !!

      Delete

Page-level ad