function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Qihao GuoQihao Guo 

how could I create a new case use apex

I just want to know if I want to create a new case by using apex, how can I develop?
Best Answer chosen by Qihao Guo
AnkaiahAnkaiah (Salesforce Developers) 
Hi Qihao,

You can try below code in your developer console annonumus window.
case cs = new case();

cs.Subject = 'test creattion of case using apex';
cs.status = 'New';
cs.origin = 'Phone';

insert cs;

if this helps, Please mark it as best answer.

thanks!!