You need to sign in to do that
Don't have an account?
Ido Greenbaum 10
Lightning Case List View custom button - assistance with tests
Can anyone please help with a test class for the following Lightning Case List View custom 'take ownership' button? :
public class CaseAcceptOwnership { PageReference cancel; Case[] records; public CaseAcceptOwnership(ApexPages.StandardSetController c) { records = (Case[])c.getSelected(); cancel = c.cancel(); } public PageReference updateCases() { for(Case record: records) { record.OwnerId = UserInfo.getUserId(); } update records; return cancel.setRedirect(true); } }
Try this code, Hope this will help you.Please make is solved.
Thanks
Hemant