• Reddy Chandra
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 4
    Replies
Hi
trigger DealBeforeUpdate on Deal__c (before update)
{
Map<Id, Deal__c> rejectedStatements = new Map<Id, Deal__c>{};

  for(Deal__c inv: trigger.new)
  {
 Deal__c oldInv = System.Trigger.oldMap.get(inv.Id);

    if (oldInv.ApprovalStatus__c != 'Rejected' 
     && inv.ApprovalStatus__c == 'Rejected')
    { 
      rejectedStatements.put(inv.Id, inv);  
    }
if(inv.Vendor__c!=null){         
        User assrep = [select id,name,ManagerId from User where id=:inv.Vendor__c];
          inv.Vendor_Manager__c = assrep.ManagerId;
      }
  }
   
  if (!rejectedStatements.isEmpty())  
  {
    AP12DealRejectedwithReason.ProvideDealWithRejectionReason(rejectedStatements);
  }
 
Regards
Reddy
Hi 
public class DealVariables {
   public static boolean approvesent=false;
    public static boolean rejectsent=false;   
  
}

thanks in advance

regards
Reddy
Hello Everyone

I have a requirement like we have an object called product it is has master detail with reference object whenever record is created in product that is also avaiable in reference object all products field .
if i delete the record in product object it should be deleted in all product field.
can any one suggest with sample trigger.

Regards
Reddy
Hi Everyone,

I have a requirement like we have one custome object in that we have two sustome  fields opportunity id and opportunity(it is look up-opportunity object) here my requirement is in opportuity object we have one custome object called opportunity number.
whenever opportuinty number = opportuinty id then i need to papulate the corrsponding opportuinty name in opportuinty object how achive it .

Thanks in advace
Regards
Reddy
Hi
trigger DealBeforeUpdate on Deal__c (before update)
{
Map<Id, Deal__c> rejectedStatements = new Map<Id, Deal__c>{};

  for(Deal__c inv: trigger.new)
  {
 Deal__c oldInv = System.Trigger.oldMap.get(inv.Id);

    if (oldInv.ApprovalStatus__c != 'Rejected' 
     && inv.ApprovalStatus__c == 'Rejected')
    { 
      rejectedStatements.put(inv.Id, inv);  
    }
if(inv.Vendor__c!=null){         
        User assrep = [select id,name,ManagerId from User where id=:inv.Vendor__c];
          inv.Vendor_Manager__c = assrep.ManagerId;
      }
  }
   
  if (!rejectedStatements.isEmpty())  
  {
    AP12DealRejectedwithReason.ProvideDealWithRejectionReason(rejectedStatements);
  }
 
Regards
Reddy
Hi Everyone,

I have a requirement like we have one custome object in that we have two sustome  fields opportunity id and opportunity(it is look up-opportunity object) here my requirement is in opportuity object we have one custome object called opportunity number.
whenever opportuinty number = opportuinty id then i need to papulate the corrsponding opportuinty name in opportuinty object how achive it .

Thanks in advace
Regards
Reddy