You need to sign in to do that
Don't have an account?

closed Date is not writable
Hi all,
I have one batch class with scenario
'SELECT ID from LiveChatTranscript where caseid in (SELECT ID from Case where Closeddate >: caseclosedate and Closeddate
i am try to delete all the livecases transcipt which are between 6 and 7 days before ,but i am facing issue in testclass because closeddate is not writable so can you please help me how can i test this scenario i tried JSON string not getting output.
I have one batch class with scenario
'SELECT ID from LiveChatTranscript where caseid in (SELECT ID from Case where Closeddate >: caseclosedate and Closeddate
i am try to delete all the livecases transcipt which are between 6 and 7 days before ,but i am facing issue in testclass because closeddate is not writable so can you please help me how can i test this scenario i tried JSON string not getting output.
Update the Case status to 'closed' after inserting the case. It will automatically populate ClosedDate.
For Example:
@isTest private class CaseCloseTest {
static testMethod void myUnitTest() {
Case c = new Case();
c.Status='New';
c.subject='Test',
insert c;
try {
c.Status='Closed';
update c;
}
Catch(Exception ee) {}
}
}
Thanks,
Sowmya