• Laura Brock
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
I have never created a new trigger before.  I have it working beautifully in UAT :-) but when I went to replicate in Production, it seems you can't just 'add' a new trigger.  It has to be moved or pushed?  And, it needs to account for testing coverage?  The code I need to move is below:

trigger TaskCompletion on Task (after insert,after update) {
    
    list<task> lst_Task = new list<task>(); 
    set<id> cID = new set<id>();
    
    Map<id,Payroll_Checklist__c> MP_chklst;
    
        for(task task_obj :trigger.new)
    {
            cID.add(task_obj.whatid);
    }

    MP_chklst = new Map<id,Payroll_Checklist__c>([SELECT ID,Checklist_Complete__c FROM Payroll_Checklist__c WHERE ID IN : cID ]);
    
    for(task task_obj :trigger.new)
    {
        if(task_obj.status == 'Completed')
        {
          MP_chklst.get(task_obj.whatid).Checklist_Complete__c = true;
        }
    }
    
        update MP_chklst.values();
}


Does anyone have some quick/easy steps to move it to Production?  And, do I need to do anything to the code to account for the testing coverage?  I'm sure this is basic, but development of triggers is new for me!
API name of custom object is "Payroll_Checklist__c".  I created a Field on this object called 'Checklist Complete?' (API Name = "Checklist_Complete__c").  Each Checklist can have 3 - 9 different tasks associated with it.  When every task status is 'Completed' (or ultimately removed from the Checklist), I want the checkbox to be trigged from default 'false' to 'true'.  It seems regular workflow will not work on this (the custom object is not 'related' to tasks).  How can I achieve this?  Seems doable, but a bit beyond my capabilities!
When a chat (Live Agent) ends, the chat transcript is being created on the wrong account?  And in some cases, the chat transcript is unable to be found...?  How can we find the chat transcripts and troubleshoot?
I have never created a new trigger before.  I have it working beautifully in UAT :-) but when I went to replicate in Production, it seems you can't just 'add' a new trigger.  It has to be moved or pushed?  And, it needs to account for testing coverage?  The code I need to move is below:

trigger TaskCompletion on Task (after insert,after update) {
    
    list<task> lst_Task = new list<task>(); 
    set<id> cID = new set<id>();
    
    Map<id,Payroll_Checklist__c> MP_chklst;
    
        for(task task_obj :trigger.new)
    {
            cID.add(task_obj.whatid);
    }

    MP_chklst = new Map<id,Payroll_Checklist__c>([SELECT ID,Checklist_Complete__c FROM Payroll_Checklist__c WHERE ID IN : cID ]);
    
    for(task task_obj :trigger.new)
    {
        if(task_obj.status == 'Completed')
        {
          MP_chklst.get(task_obj.whatid).Checklist_Complete__c = true;
        }
    }
    
        update MP_chklst.values();
}


Does anyone have some quick/easy steps to move it to Production?  And, do I need to do anything to the code to account for the testing coverage?  I'm sure this is basic, but development of triggers is new for me!
API name of custom object is "Payroll_Checklist__c".  I created a Field on this object called 'Checklist Complete?' (API Name = "Checklist_Complete__c").  Each Checklist can have 3 - 9 different tasks associated with it.  When every task status is 'Completed' (or ultimately removed from the Checklist), I want the checkbox to be trigged from default 'false' to 'true'.  It seems regular workflow will not work on this (the custom object is not 'related' to tasks).  How can I achieve this?  Seems doable, but a bit beyond my capabilities!
When a chat (Live Agent) ends, the chat transcript is being created on the wrong account?  And in some cases, the chat transcript is unable to be found...?  How can we find the chat transcripts and troubleshoot?