I have a case which has ownerid as'005b0000000suX5AAI' . i want to assign this id to a new case which is going to be created. Is this possible ? If yes, please tell me how.

Thanks in advance !!!


Yes, its possible if you have owner of 1st case which is already created. for example:

case case1= [select id,ownerId from case where id='case id whose owner is to be copied'];

case case2=new case();

case2.Status = 'New';

case2.ownerId = case1.ownerId;

insert case2; 

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.