• Jenny Chen 9
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 2
    Replies
Hello, 
we have a lot of nightly batch jobs. However, some jobs hit limits of 50,000, but with our growing org and data, it is hard to find the daily change and process the changed data and still within the limits. 
I am thinking about data warehouse solutions. 
Do you have any good small to mid size data warehouse recommendation? Really appreciate your help. 
 
I need to do something in opportunity clone, but not for opportunity edit. Is there a way to differentiate this in Apex trigger ? It will come from "clone" or "Edit" opportunity button and in Apex trigger for update. 

Thanks for your help. 
Hello, 
I have an Apex trigger on a custom object, it is based on insert, once a new object created, an email will send out to the owner. i have deactivated this trigger, however, i continue to get email. I deactivated other triggers on this custom object. still got email. Why?

Is it possible some caching somewhere on the Exchange 2010 which is my company's mail server? has anyone experienced issue like this before? 
Thank you so much for your help. 
 
Hello, 
I have an Apex trigger on a custom object, which sent an email message , it was working. but i need to change the htmlbody text due to user request. However, after i changed it to below. The emails continue to contain the old htmlbody that was before. only simple text changed. no change on link or others. I don't get it why. Please help. Thank you!

**************************************
String htmlBody='Dear '+p.Owner.Name+','+'<br/>'+'<br/>';             
                htmlBody+=o.Contact_Name__c+' from ';
                htmlBody+=o.Account_Name__c+test;
                
                htmlBody+=' has recently provided feedback'+','+'a full copy of which can be found at '+'<br/>';
                //htmlBody+='<a href='+Url1+'></a>'+'<br/>'+'<br/>';
                htmlBody+= URL.getSalesforceBaseUrl().toExternalForm()+ '/'+o.id+'<br/>'+'<br/>';  
                
                htmlBody+='Please review the survey feedback, including any comments, and follow-up with the customer. '+'<br/>';      
                     
                htmlBody+='<br/>';
                htmlBody+='Regards,'+'<br/>'+'<br/>'; 
                htmlBody+='Global Customer Advocacy'+'<br/>';

                String plainTextBody=htmlBody;
                Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
                mail.setSubject(subject);
                mail.setHtmlBody(htmlBody);
                
                if (p.Owner.email!=null){
                    mail.setToAddresses(new String[]{p.Owner.email});    
                }
                   
                Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
Hello, 

I got this error when i tried to deploy my codes to production. Usually it is easier to see where it came from, but not this time. I am not sure where the "GroupAlert" came from. then i am not sure where the Stack Trace "Class.GroupAlert.GroupAlert.loadRulesAndGroup" and "Class.GroupAlert.GroupAlert" below come from??

Error message: 
System.LimitException: GroupAlert:Too many SOQL queries: 101 
Stack Trace: Class.GroupAlert.GroupAlert.loadRulesAndGroup: line 65, column 1 Class.GroupAlert.GroupAlert.<init>: line 41, column 1 Trigger.GroupAlert.GroupAlertLeadFeed: line 19, column 1
I had tried different triggers on Assets, however, none of them works. Even simple 'before insert' trigger. Then I did a simple workflow, it worked, however, for my requirements, simple workflow does not work. I need to update a value on Account which is parents of Assets, the value need to come from most recent date value from latest created Asset. 
 
I created my triggers under the standard object 'Asset', triggers. The only thing i noticed here is after i created the trigger, the sobject on top of the trigger section from is not 'Assets', which is different than other objects is
Sobject TypeAssets Owned - Epicor
 
Not sure why it is not “Assets”. Do you have any ideas of how to make this trigger work?



Apex Trigger Detail
Sobject Type:  Assets Owned - Epicor
Code below: 
trigger MaintenanceExpiration on Asset (after insert) {

    Set<ID> acctId = new Set<ID>();

    for(Asset ass: Trigger.new) {
        acctId.add(ass.Account.id);
    }
    List<Account> acctList=[SELECT id, Maintenance_Expiration__C from Account where id in :acctId];
    
    for(Asset ass: Trigger.new) {
        for( Account a: acctList){
           if (ass.Account.id==a.Id){
                if (a.Maintenance_Expiration__C==null){
                    Datetime epday = trigger.new[i].Maintenance_Expiry_Date__c;
                    a.Maintenance_Expiration__C= date.newInstance(epday.year(), epday.month(),epday.day());
                }
                else if(a.Maintenance_Expiration__C<trigger.new[i].Maintenance_Expiry_Date__c){
                    Datetime epday = trigger.new[i].Maintenance_Expiry_Date__c;
                    a.Maintenance_Expiration__C= date.newInstance(epday.year(), epday.month(),epday.day());

                }
                
          }
        }
    }
     if(acctList!=null && acctList.size()>0){
           //update account list;
           update acctList;
       }
    
}


 
Hello, 
I need to calculate Apex Code coverage we have in full copy sandbox. We have close to 500 Apex Test Classes (300 for AppExchange). 

I can run non-AppExchange Apex Test Classes a dozen a time out of the 200, but the Apex Code coverage number are all over the place, very low 50-60%. I don't think we are that low, because we did not have occurance that we could not deploy to production due to low coverage rate in the past. 

The doucments said should click button "Run All Tests" (close to 500 including 300 AppExchange ones) , but it took forever and never finish. I would really appreciate for any advice. 
 
This happened when i finished step "Use Events to Add Markers to the Map". When i tried to see it in Salesforce1 as "https://na16.lightning.force.com/one/one.app"

I got this error: 
Uncaught error in actionCallback : Cannot read property 'setParams' of null
Hello, 
I have an Apex trigger on a custom object, it is based on insert, once a new object created, an email will send out to the owner. i have deactivated this trigger, however, i continue to get email. I deactivated other triggers on this custom object. still got email. Why?

Is it possible some caching somewhere on the Exchange 2010 which is my company's mail server? has anyone experienced issue like this before? 
Thank you so much for your help. 
 
I had tried different triggers on Assets, however, none of them works. Even simple 'before insert' trigger. Then I did a simple workflow, it worked, however, for my requirements, simple workflow does not work. I need to update a value on Account which is parents of Assets, the value need to come from most recent date value from latest created Asset. 
 
I created my triggers under the standard object 'Asset', triggers. The only thing i noticed here is after i created the trigger, the sobject on top of the trigger section from is not 'Assets', which is different than other objects is
Sobject TypeAssets Owned - Epicor
 
Not sure why it is not “Assets”. Do you have any ideas of how to make this trigger work?



Apex Trigger Detail
Sobject Type:  Assets Owned - Epicor
Code below: 
trigger MaintenanceExpiration on Asset (after insert) {

    Set<ID> acctId = new Set<ID>();

    for(Asset ass: Trigger.new) {
        acctId.add(ass.Account.id);
    }
    List<Account> acctList=[SELECT id, Maintenance_Expiration__C from Account where id in :acctId];
    
    for(Asset ass: Trigger.new) {
        for( Account a: acctList){
           if (ass.Account.id==a.Id){
                if (a.Maintenance_Expiration__C==null){
                    Datetime epday = trigger.new[i].Maintenance_Expiry_Date__c;
                    a.Maintenance_Expiration__C= date.newInstance(epday.year(), epday.month(),epday.day());
                }
                else if(a.Maintenance_Expiration__C<trigger.new[i].Maintenance_Expiry_Date__c){
                    Datetime epday = trigger.new[i].Maintenance_Expiry_Date__c;
                    a.Maintenance_Expiration__C= date.newInstance(epday.year(), epday.month(),epday.day());

                }
                
          }
        }
    }
     if(acctList!=null && acctList.size()>0){
           //update account list;
           update acctList;
       }
    
}