• Guru sfdc
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 22
    Replies
Hi All,
 
Can anyone please help me to create a batch apex using below trigger.
 
Thanks,
 
Hi All,

Facing the issues like getting a System.LimitException: Apex CPU time limit exceeded when trying to update my opportunities. Via data loader can someone please help me on this code, so we don't run into this error anymore and how to avoid it again with future Triggers.
 
Thanks
 
Hi Team,
 
We have one requirement like we have 5 conditions. Any one condition is met then check box should be update. For that i have written one trigger on opportunity using before event
 
The problem is: In scorecard object when matching any criteria then in the opportunity "Deal” should be true. Which is working fine my question is after matching any criteria in scorecard object in the opportunity need to updated deal = check when refreshing the opty page. Here we are updating the field every time which is not correct
Can anyone please help me on this?
Thanks
 
Hi All,
When we are trying to save the trigger getting error like “Method does not exist or incorrect signature: [Id].contains (String) ”.Please help us on this

Please check my below bit of logic:

List<Opportunity_Splits__c> PODS = [SELECT Account__c,Amount__c,Id,Name,Opportunity__c,Split_Percentage__c FROM Opportunity_Splits__c where Opportunity__c IN:trigger.newmap.keyset()];
    for(Opportunity_Splits__c POS: PODS ){
        if(opppartnerorderMap.containskey(POS.Opportunity__c))
        opppartnerorderMap.get(POS.Opportunity__c).add(POS);
        else{
            List<Opportunity_Splits__c> podslist = new List<Opportunity_Splits__c>();
            podslist .add(POS);
            opppartnerorderMap.put(POS.Opportunity__c,podslist);
        }
    }

for(Opportunity_Splits__c POS : opppartnerorderMap.get(opp.id))
                        if(POS.Account__c.contains(' platforms')&&(date.valueOf(opp.createdDate).daysBetween(date.valueOf(opp.CloseDate))<=30))
                        {opp. Checkbox =true;
                            break;
                        }
                        else if(!POS.Account__c.contains('platforms')&&(date.valueOf(opp.createdDate).daysBetween(date.valueOf(opp.CloseDate))<=45))
                        opp.Checkbox=true;

Thanks

 
Hi Team,
 
Can anyone please help me to from new trigger logic to existing trigger handler trigger.
We have created one trigger and one apex class related to Account. But the problem is we don't want to create every time new trigger. We have a trigger called "Account Trigger" contains below Logic:
 
Account Trigger which is having old one:
Trigger Account Trigger on Account (before insert, before update, before delete, after insert, after update, after delete, after undelete)
{
AccountTriggerHandler handler = new AccountTriggerHandler(Trigger.isExecuting, Trigger.size, Trigger.old, Trigger.new, Trigger.oldmap, Trigger.newmap);
    AccountTriggerHandlerAlwaysOn handlerAlwaysOn = new AccountTriggerHandlerAlwaysOn(Trigger.isExecuting, Trigger.size, Trigger.old, Trigger.new, Trigger.oldmap, Trigger.newmap); 
    if(Trigger.isDelete && Trigger.isAfter)
        handlerAlwaysOn.onAfterDelete();
    if(Trigger.isDelete && Trigger.isBefore)
        handlerAlwaysOn.onBeforeDelete();
    if(Trigger.isInsert && Trigger.isBefore)
        handlerAlwaysOn.onBeforeInsert();
    if(Trigger.isUpdate && Trigger.isBefore)
        handlerAlwaysOn.onBeforeUpdate();
    if(Trigger.isInsert && Trigger.isAfter)
        handlerAlwaysOn.onAfterInsert();
    if(Trigger.isUpdate && Trigger.isAfter)
        handlerAlwaysOn.onAfterUpdate();  
    if(Trigger.isInsert && Trigger.isBefore)
        handler.onBeforeInsert();       
    if(Trigger.isUPdate && Trigger.isBefore)
        handler.onBeforeUpdate(); 
    if(Trigger.isInsert && Trigger.isAfter)
        handler.OnAfterInsert();   
    if(Trigger.isUpdate && Trigger.isAfter)
        handler.OnAfterUpdate();       
    if(Trigger.isUndelete && Trigger.isAfter)
        handler.onAfterUndelete();          
}
 
Account Trigger which is created new One:
 
Trigger AccountType on Account (after update){
   {
AccountTypecls acpt = new AccountTypecls();
        if(AccountTypecls.Aptcalc)
        acpt.AccountTypecalc(Trigger.new,trigger.newmap,trigger.oldmap);      
     }
}
 
Hear i want to include my newly created trigger to old trigger handler. Please help us.
 
Thanks
 
 
Hi All,

Facing the test class problem for Partner Object."System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: OpportunityId, AccountToId (account to cannot be opportunity account): [OpportunityId, AccountToId]"

  Partner thisPartner = new Partner();
        thisPartner.Role = 'Test Role';
        thisPartner.IsPrimary = true;
        thisPartner.OpportunityId = opp.id;
        thisPartner.AccountToId = acc.id;
        insert thisPartner;
    }
Please help me on this.
Thanks

 
Hi All,
 
Can anyone please help me to create a batch apex using below trigger.
 
Thanks,
 
Hi All,

Facing the issues like getting a System.LimitException: Apex CPU time limit exceeded when trying to update my opportunities. Via data loader can someone please help me on this code, so we don't run into this error anymore and how to avoid it again with future Triggers.
 
Thanks
 
Hi Team,
 
We have one requirement like we have 5 conditions. Any one condition is met then check box should be update. For that i have written one trigger on opportunity using before event
 
The problem is: In scorecard object when matching any criteria then in the opportunity "Deal” should be true. Which is working fine my question is after matching any criteria in scorecard object in the opportunity need to updated deal = check when refreshing the opty page. Here we are updating the field every time which is not correct
Can anyone please help me on this?
Thanks
 
Hi All,
When we are trying to save the trigger getting error like “Method does not exist or incorrect signature: [Id].contains (String) ”.Please help us on this

Please check my below bit of logic:

List<Opportunity_Splits__c> PODS = [SELECT Account__c,Amount__c,Id,Name,Opportunity__c,Split_Percentage__c FROM Opportunity_Splits__c where Opportunity__c IN:trigger.newmap.keyset()];
    for(Opportunity_Splits__c POS: PODS ){
        if(opppartnerorderMap.containskey(POS.Opportunity__c))
        opppartnerorderMap.get(POS.Opportunity__c).add(POS);
        else{
            List<Opportunity_Splits__c> podslist = new List<Opportunity_Splits__c>();
            podslist .add(POS);
            opppartnerorderMap.put(POS.Opportunity__c,podslist);
        }
    }

for(Opportunity_Splits__c POS : opppartnerorderMap.get(opp.id))
                        if(POS.Account__c.contains(' platforms')&&(date.valueOf(opp.createdDate).daysBetween(date.valueOf(opp.CloseDate))<=30))
                        {opp. Checkbox =true;
                            break;
                        }
                        else if(!POS.Account__c.contains('platforms')&&(date.valueOf(opp.createdDate).daysBetween(date.valueOf(opp.CloseDate))<=45))
                        opp.Checkbox=true;

Thanks

 
Hi Team,
 
Can anyone please help me to from new trigger logic to existing trigger handler trigger.
We have created one trigger and one apex class related to Account. But the problem is we don't want to create every time new trigger. We have a trigger called "Account Trigger" contains below Logic:
 
Account Trigger which is having old one:
Trigger Account Trigger on Account (before insert, before update, before delete, after insert, after update, after delete, after undelete)
{
AccountTriggerHandler handler = new AccountTriggerHandler(Trigger.isExecuting, Trigger.size, Trigger.old, Trigger.new, Trigger.oldmap, Trigger.newmap);
    AccountTriggerHandlerAlwaysOn handlerAlwaysOn = new AccountTriggerHandlerAlwaysOn(Trigger.isExecuting, Trigger.size, Trigger.old, Trigger.new, Trigger.oldmap, Trigger.newmap); 
    if(Trigger.isDelete && Trigger.isAfter)
        handlerAlwaysOn.onAfterDelete();
    if(Trigger.isDelete && Trigger.isBefore)
        handlerAlwaysOn.onBeforeDelete();
    if(Trigger.isInsert && Trigger.isBefore)
        handlerAlwaysOn.onBeforeInsert();
    if(Trigger.isUpdate && Trigger.isBefore)
        handlerAlwaysOn.onBeforeUpdate();
    if(Trigger.isInsert && Trigger.isAfter)
        handlerAlwaysOn.onAfterInsert();
    if(Trigger.isUpdate && Trigger.isAfter)
        handlerAlwaysOn.onAfterUpdate();  
    if(Trigger.isInsert && Trigger.isBefore)
        handler.onBeforeInsert();       
    if(Trigger.isUPdate && Trigger.isBefore)
        handler.onBeforeUpdate(); 
    if(Trigger.isInsert && Trigger.isAfter)
        handler.OnAfterInsert();   
    if(Trigger.isUpdate && Trigger.isAfter)
        handler.OnAfterUpdate();       
    if(Trigger.isUndelete && Trigger.isAfter)
        handler.onAfterUndelete();          
}
 
Account Trigger which is created new One:
 
Trigger AccountType on Account (after update){
   {
AccountTypecls acpt = new AccountTypecls();
        if(AccountTypecls.Aptcalc)
        acpt.AccountTypecalc(Trigger.new,trigger.newmap,trigger.oldmap);      
     }
}
 
Hear i want to include my newly created trigger to old trigger handler. Please help us.
 
Thanks
 
 
Hi All,

Facing the test class problem for Partner Object."System.DmlException: Insert failed. First exception on row 0; first error: FIELD_INTEGRITY_EXCEPTION, field integrity exception: OpportunityId, AccountToId (account to cannot be opportunity account): [OpportunityId, AccountToId]"

  Partner thisPartner = new Partner();
        thisPartner.Role = 'Test Role';
        thisPartner.IsPrimary = true;
        thisPartner.OpportunityId = opp.id;
        thisPartner.AccountToId = acc.id;
        insert thisPartner;
    }
Please help me on this.
Thanks