• priya sri
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies

its not updating the close date??? 
    it has to update close date before 90days??

Trigger for opportunity is renewal then its become clonewhen ever opportunity is renewal then its become clone...
for this :::

trigger RenewalOpportunityClone on Opportunity (after update, after insert) {
    List<Id> opps = new List<Id>();
    
    for( Opportunity opp : Trigger.new ) {
        if ( opp.RecordTypeId != '01290000000Hqw2' ) 
{
            continue;
        }
        
        if( !opp.Renew_Now__c)  {
            continue;
        }

        opps.add( opp.Id );
    }
    
    
    Map<Id,Opportunity> oppsMap = new Map<Id,Opportunity>( [SELECT Id,OwnerId,Account.OwnerId, Original_Opportunity_ID__c,AccountId, Branch__c,Line_of_Business__c,Name,Contact__c,Renew_Now__c,Monthly_Spend__c, RecordTypeId from Opportunity where Id IN :opps] );
    
    List<Opportunity> renewalOpps = new List<Opportunity>();
    
    for( Opportunity opp : oppsMap.values() ) {
        Opportunity renewalOpp = new Opportunity();
        
        Date renewalDate = Date.today();
        Date closeDate = Date.today();
        
        
        String renewalDateString = '' + renewalDate;
        renewalDateString = renewalDateString.substring(0, renewalDateString.indexOf(' '));
        
        renewalOpp.CloseDate = closeDate + 365;
        renewalOpp.OwnerId = opp.Account.OwnerId;
        renewalOpp.AccountId = opp.AccountId;
        renewalOpp.Contact__c= opp.Contact__c;
        renewalOpp.NextStep= 'Review Account Status, send renewal notice and quote.';
        
        renewalOpp.Monthly_Spend__c = opp.Monthly_Spend__c;
        renewalOpp.StageName = 'First Meeting';
        renewalOpp.Branch__c = opp.Branch__c;
        renewalOpp.Line_of_Business__c= opp.Line_of_Business__c;
        renewalOpp.Name = opp.Name;
        renewalOpp.Original_Opportunity_ID__c=opp.Original_Opportunity_ID__c;
        renewalOpp.Is_Cloned__c = true ;
        renewalOpp.Cloned_from_Opportunity_ID__c='https://cs5.salesforce.com/'+opp.Id;
        renewalOpps.add(renewalOpp);
        opp.Renew_Now__c = false ;
        opp.Is_Master__c = false ;
        
        update opp;
    }
    
    insert renewalOpps;
    
    
    
    
}
 
when ever opportunity is renewal then its become clone...
for this :::

trigger RenewalOpportunityClone on Opportunity (after update, after insert) {
    List<Id> opps = new List<Id>();
    
    for( Opportunity opp : Trigger.new ) {
        if ( opp.RecordTypeId != '01290000000Hqw2' ) 
{
            continue;
        }
        
        if( !opp.Renew_Now__c)  {
            continue;
        }

        opps.add( opp.Id );
    }
    
    
    Map<Id,Opportunity> oppsMap = new Map<Id,Opportunity>( [SELECT Id,OwnerId,Account.OwnerId, Original_Opportunity_ID__c,AccountId, Branch__c,Line_of_Business__c,Name,Contact__c,Renew_Now__c,Monthly_Spend__c, RecordTypeId from Opportunity where Id IN :opps] );
    
    List<Opportunity> renewalOpps = new List<Opportunity>();
    
    for( Opportunity opp : oppsMap.values() ) {
        Opportunity renewalOpp = new Opportunity();
        
        Date renewalDate = Date.today();
        Date closeDate = Date.today();
        
        
        String renewalDateString = '' + renewalDate;
        renewalDateString = renewalDateString.substring(0, renewalDateString.indexOf(' '));
        
        renewalOpp.CloseDate = closeDate + 365;
        renewalOpp.OwnerId = opp.Account.OwnerId;
        renewalOpp.AccountId = opp.AccountId;
        renewalOpp.Contact__c= opp.Contact__c;
        renewalOpp.NextStep= 'Review Account Status, send renewal notice and quote.';
        
        renewalOpp.Monthly_Spend__c = opp.Monthly_Spend__c;
        renewalOpp.StageName = 'First Meeting';
        renewalOpp.Branch__c = opp.Branch__c;
        renewalOpp.Line_of_Business__c= opp.Line_of_Business__c;
        renewalOpp.Name = opp.Name;
        renewalOpp.Original_Opportunity_ID__c=opp.Original_Opportunity_ID__c;
        renewalOpp.Is_Cloned__c = true ;
        renewalOpp.Cloned_from_Opportunity_ID__c='https://cs5.salesforce.com/'+opp.Id;
        renewalOpps.add(renewalOpp);
        opp.Renew_Now__c = false ;
        opp.Is_Master__c = false ;
        
        update opp;
    }
    
    insert renewalOpps;
    
    
    
    
}

















 
hi
   If we done a deployment of 63% but due to some exceptions can we go back to deployment (undeploy)? is it possible? how?
hi 
   I need some advance admin 301 dumps please?
   email- supriya.shukla87@gmail.com
what is code handling?
 What are the key points off territory management?
hi
In visualforce we using vf tags and written some code. so were these tags gets stored? and
in visualforce we written javascript and writtern some x code..so were these javascript gets stored?

thankyou
Hi,

I have written a trigger on account. On updating the Program status on Account, it update the Opportunity Stage Name and there is another trigger return on Opportunity. The problem is while using bulk update from data loader it is causing problem. Can anyone please provide suggestion
when ever opportunity is renewal then its become clone...
for this :::

trigger RenewalOpportunityClone on Opportunity (after update, after insert) {
    List<Id> opps = new List<Id>();
    
    for( Opportunity opp : Trigger.new ) {
        if ( opp.RecordTypeId != '01290000000Hqw2' ) 
{
            continue;
        }
        
        if( !opp.Renew_Now__c)  {
            continue;
        }

        opps.add( opp.Id );
    }
    
    
    Map<Id,Opportunity> oppsMap = new Map<Id,Opportunity>( [SELECT Id,OwnerId,Account.OwnerId, Original_Opportunity_ID__c,AccountId, Branch__c,Line_of_Business__c,Name,Contact__c,Renew_Now__c,Monthly_Spend__c, RecordTypeId from Opportunity where Id IN :opps] );
    
    List<Opportunity> renewalOpps = new List<Opportunity>();
    
    for( Opportunity opp : oppsMap.values() ) {
        Opportunity renewalOpp = new Opportunity();
        
        Date renewalDate = Date.today();
        Date closeDate = Date.today();
        
        
        String renewalDateString = '' + renewalDate;
        renewalDateString = renewalDateString.substring(0, renewalDateString.indexOf(' '));
        
        renewalOpp.CloseDate = closeDate + 365;
        renewalOpp.OwnerId = opp.Account.OwnerId;
        renewalOpp.AccountId = opp.AccountId;
        renewalOpp.Contact__c= opp.Contact__c;
        renewalOpp.NextStep= 'Review Account Status, send renewal notice and quote.';
        
        renewalOpp.Monthly_Spend__c = opp.Monthly_Spend__c;
        renewalOpp.StageName = 'First Meeting';
        renewalOpp.Branch__c = opp.Branch__c;
        renewalOpp.Line_of_Business__c= opp.Line_of_Business__c;
        renewalOpp.Name = opp.Name;
        renewalOpp.Original_Opportunity_ID__c=opp.Original_Opportunity_ID__c;
        renewalOpp.Is_Cloned__c = true ;
        renewalOpp.Cloned_from_Opportunity_ID__c='https://cs5.salesforce.com/'+opp.Id;
        renewalOpps.add(renewalOpp);
        opp.Renew_Now__c = false ;
        opp.Is_Master__c = false ;
        
        update opp;
    }
    
    insert renewalOpps;
    
    
    
    
}

















 
hi
   If we done a deployment of 63% but due to some exceptions can we go back to deployment (undeploy)? is it possible? how?
what is code handling?
 What are the key points off territory management?