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
hk7965hk7965 

Trigger not working

Hi ,

I have created 2 cutom objects Project,Assignment. We configure Project request Assignment details in Assignment Object .  Based on Queue selected on Project Object, trigger should lookup user in Assignment object and get user ID in a user lookup field in Project object. 

But I am not getting value as expected, Please help me to correct this issue.




trigger Mapping on Project__c (before insert,before update) {
     try{
   
    set<ID> SGPID = new set <ID>();
         For (Project__C PA :Trigger.new){
             if (PA.Group != null)
            SGPID.add( PA.Group);
         }
             
               
          Map<Id,Assignment> KR = new Map<Id,Assignment> ([select user from Assignment where group =:SGPID]);
        
 
        For (Project__C PA :Trigger.new)
              PA.user =KR.get(KA.group).Assignment;
      
    }
    catch(Exception e)
    {}
   
}

Regards
Krishna
Vinit_KumarVinit_Kumar
How Assignment and Project object are related ??