• Sandilya kumar
  • NEWBIE
  • 10 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 0
    Replies
Create a custom object, Work Order object. It should have a country field. When we are creating a new record for WorkOrder, The WorkOrder's owner should assign to a user who is specific to the Region based on the country field. 

Create two custom objects( Region__c ,  Region_Country__c). Region object should have User lookup. Region_Country__c should have all the countries list with Regions.
trigger WorkOrders on WorkOrder (after insert) {
    set<Country__c> con =new set<Country__c>();
    list<Workorder__C>worklist=new list<Workorder__C>();
    list<Workorder__C>work_list=new list<Workorder__C>();
    
    list<Region__c>Reglist=new list<Region__c>();
   
    if(trigger.isinsert)                              
    {
        for(Region__c R:trigger.new)
        {
            Reglist = [select User__c from Workorder__C ];
        }
    }
    if (trigger.isdelete)                         
    {
        for(contact con:trigger.old)
        {
            accid.add(con.accountid);
        }
    }
    acclist=[SELECT id,name FROM account WHERE id in:accid];
    contactlist=[SELECT id,name,accountid FROM contact WHERE accountid in:accid];
 

}

Since am new to developing am trying to solve the use case,please can anyone help me .
thanks in advance.

I have created a lightening application and i would like to make the lightening app into classic ?
How can i acheive this ?