• Jyoti Sahoo 3
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 1
    Replies
Hi, Can someone please help me writing the test class for the below trigger - 

 
trigger UpdateStatus on Advisement__c (after update) {

    List<Case> parentObjList = new List<Case>();
    List<Advisement__c> childObjList = new List<Advisement__c>();
    List<Id> listIds = new List<Id>();

    
    Integer i=0;
    Integer count = 0;

    for (Advisement__c childObj : Trigger.old) {
        Case co = [Select Id, Status from Case where Id =: childObj.Case__c];

        childObjList = [SELECT id,Case__c, Status__c FROM Advisement__c where Case__c =:co.Id];
        
        for (Advisement__c adv : childObjList){
           
            if(adv.Status__c == 'Done' || adv.Status__c == 'Approved with Signature' || adv.Status__c == 'Declined')
            {
              i = 0;
              count = count + 1;
              }
              
            else
            {
              i = 1;
        
            }
         }
            if ( childObjList.size() == count) {
                
                    co.Status = 'Final Review';
                    }
            else{
                    co.Status = 'In Progress';
                }
                    
    update co;
            
        
    }
How to print service report from Field service lightning mobile app? with below limitations. Any help is much appreciated.

Few limitations - I cannot use VF, javascript or any of that sort. 
Hi All,

Do we have alias for Field names in SOQL as we have in SQL. 
I know we have alias for aggregate functions , but i have a need where i want alias for field names as two of my field API names are same.

Thanks in advance