• gb.apex
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Hi All,
its too urgent, am written a batch class for populate the approval comment field in order object. now i am facing this error can u any one please help me to avoid governerlimits..thank alot in advance

global void execute(Database.BatchableContext BC,List<Order_vod__c> scope)
  {
      List<Order_vod__c> updOrdlist = new List<Order_vod__c>();
      //for(Order_vod__c order : scope)
      //{                      
      //   updOrdlist =  createOrdCmnts(scope);
      //}  
      for(Order_vod__c o2:scope)
      {
         ProcessInstance [] op = [SELECT Id,Status,targetobjectid,(SELECT Id,Comments FROM Steps) FROM ProcessInstance where targetobjectid = : o2.id limit 1];
        
         system.debug('1--------------Order ID -------------->'+ o2.id);
         system.debug('2-------------Process Instance -------------->'+ op);
        
         for (ProcessInstance op1 : op)
         {
            for (ProcessInstanceStep pis : op1.Steps)
            {
               system.debug('4-------------Process Instance Steps-------------->'+ pis);
               if(op1.Status == 'Approved')
               {
                   o2.PFE_IT_Approval_Comment__c = pis.Comments;
                   system.debug('3-------------o2.PFE_IT_Approval_Comment__c-------------->'+ o2.PFE_IT_Approval_Comment__c);
               }
            }
         }
         updOrdlist.add(o2);
      }
      system.debug('5-------------updOrdlist-------------->'+ updOrdlist);
      update updOrdlist;
    }

Hi All,

i have requirement like this. one custom object calleed "obj1" is there.we are created approval process on it.when manager rejected approval with comments that comments has to show on obj1 pagelayout. for that am created a f"ield1". so now how to get the comment  value to

field1".

Thanks in advance. It's urget plese reply asap.

Hi All,
its too urgent, am written a batch class for populate the approval comment field in order object. now i am facing this error can u any one please help me to avoid governerlimits..thank alot in advance

global void execute(Database.BatchableContext BC,List<Order_vod__c> scope)
  {
      List<Order_vod__c> updOrdlist = new List<Order_vod__c>();
      //for(Order_vod__c order : scope)
      //{                      
      //   updOrdlist =  createOrdCmnts(scope);
      //}  
      for(Order_vod__c o2:scope)
      {
         ProcessInstance [] op = [SELECT Id,Status,targetobjectid,(SELECT Id,Comments FROM Steps) FROM ProcessInstance where targetobjectid = : o2.id limit 1];
        
         system.debug('1--------------Order ID -------------->'+ o2.id);
         system.debug('2-------------Process Instance -------------->'+ op);
        
         for (ProcessInstance op1 : op)
         {
            for (ProcessInstanceStep pis : op1.Steps)
            {
               system.debug('4-------------Process Instance Steps-------------->'+ pis);
               if(op1.Status == 'Approved')
               {
                   o2.PFE_IT_Approval_Comment__c = pis.Comments;
                   system.debug('3-------------o2.PFE_IT_Approval_Comment__c-------------->'+ o2.PFE_IT_Approval_Comment__c);
               }
            }
         }
         updOrdlist.add(o2);
      }
      system.debug('5-------------updOrdlist-------------->'+ updOrdlist);
      update updOrdlist;
    }
Hi,
I have a custom button through which i am submitting a record for approval.
So i want to remove the standard 'Submit For Approval' and 'Recall Approval Request' button from the approval history related List.
I tried to create a Home Page Component to hide it, but it doesn't work.
Please let me know whether i am missing out something.

Below is my code:

<script>
$j = jQuery.noConflict();
$j("input[name='piSubmit']").hide();
</script>

Thanks.