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
Girish Reddy 52Girish Reddy 52 

are we having only case and lead for assignment rule ?

I'm confused in assignment rule & queue , if we want to automate tranfer of owners of other than lead and case object, what should be done .

Please someone clarify my doubt
Tthank You
Best Answer chosen by Girish Reddy 52
Yogendra JangidYogendra Jangid
Hi Girish, 
We have assignment rules only for case and lead object. Incase you wish to automate the process for other objects, consider implementing trigger/process builder on that object and based on criteria owner can be assigned to user or customer portal user or partner user only. We can't set a queue for objects other than case and lead.
Hope this answers your question and if so please can you mark as best answer.

All Answers

Yogendra JangidYogendra Jangid
Hi Girish, 
We have assignment rules only for case and lead object. Incase you wish to automate the process for other objects, consider implementing trigger/process builder on that object and based on criteria owner can be assigned to user or customer portal user or partner user only. We can't set a queue for objects other than case and lead.
Hope this answers your question and if so please can you mark as best answer.
This was selected as the best answer
PriyaPriya (Salesforce Developers) 
Hi Girish,

Yes We have two assignment rules (Lead & Case Assignment). 
Lead assignment rules can assign leads regardless of whether leads are created manually, are generated from Web-to-Lead forms, or are imported using the Data Import Wizard.
Case assignment rules can assign cases regardless of how cases are created. Cases can be created manually or automatically using Web-to-Case, Email-to-Case, On-Demand Email-to-Case, the Self-Service portal, the Customer Portal, Outlook, or Lotus Notes.

1. And to change the owner of the record, you can write code as well :- 
Here is sample code that should give you idea.
public without sharing class noSharing { 
 public static void changeOwner(Account acc, User us)
 { 
   acc.OwnerId = us.Id;
     update acc;
 }
} 


2. Process builder to change the owner of the record. You can take idea from below link :- 
https://help.salesforce.com/articleView?id=000337519&type=1&mode=1

https://trailblazers.salesforce.com/answers?id=9063A000000iXx7QAE

3. You can also implement Trigger. Here is the sample code :- 
 

trigger UpdateOwnerID on Project__c(before insert, before update) {
     Set<string> aliasscope = new Set<String>();
      for(Project__c opp : trigger.new)
      {
              aliasscope.add(opp.Assigned_To__c);
       }
    map<string,id> userIdbyAlias = new map<string,id>();  //Keep in mind this will only store one user id per alias
    for(User u : [Select id,Name from user where Name IN :aliasscope])
    {
            userIdbyAlias.put(u.Name,u.Id);
     }
    for (Project__c objOpportunity : Trigger.new)
    {
       

             if (objOpportunity.OwnerId <> userIdByAlias.get(objOpportunity.Assigned_To__c) )           
             {
                   objOpportunity.OwnerId = userIdByAlias.get(objOpportunity.Assigned_To__c);
              }
         
    }

}
 

Please mark it as Best Answer so that it can help others in the future.

Regards,

Priya Ranjan