+ Start a Discussion
Gopinath418Gopinath418 

If we create a case record by using apex coding then the 'assignment rule' will assign that case to the user/queue?

rajat Maheshwari 6rajat Maheshwari 6

Hi Gopinath,

As per your requirement, I will suggest you the following steps : - 

1. Create Checkbox field (Any Name) ex-  "CreateFromCoding" on case object. (Hidden from Pagelayout)
2. In your caseCreation coding, where you are creating case through logic, Please add one statement also there to assign true value to these field. Ex- 

Case cs c= new Case ();
cs.CreateFromCoding = true;
insert cs;

3. Now In your assignment rule, Put criterion (Case.CreateFromCoding = true), then these case will be assign to "ABCD"(User or Queue).

 

Please let me know in case of any help :)

 

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com

Gopinath418Gopinath418
Hi Rajat,

That means If we create a case record through apex code then the assignment rule wont be assining the user/queue to the case ?

 
rajat Maheshwari 6rajat Maheshwari 6

Hi Gopinath,

When your case will create, Your assignment rule will assign the newly created case from coding to perticular user/queue...

You need to follow the steps which I have mentioned.

 

Thanks
Rajat Maheshwari
rajatzmaheshwari@gmail.com

Gopinath418Gopinath418
Hi Rajat,
What will hapeen if i don't create 'CreateFromCoding' checkbox field and don't use it in assignment rule criteria? Will the created record assigned to the user?

Thanks 
Gopinath
rajat Maheshwari 6rajat Maheshwari 6

Gopinath,

1. Then in that case, you will handle assignment part in the coding itself.

2. If you want to use standard salesforce assignment rule, then you need to follow the steps which I have discussed.

Thanks
 

Jonathan Meltzer 14Jonathan Meltzer 14
I have actually tried this, and the assignment rule is not firing correctly for the inserted case.