• gpforce
  • NEWBIE
  • 0 Points
  • Member since 2012
  • Salesforce developer

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi,
I have a lightning component as part of a managed package that uses few custom labels. The custom labels are saved with the default namespace like "{!$Label.c.<label_name>}". I am trying to update this line with the relevent namespace like "{!$Label.<nameSpace>.<label_name>}". After changing the namespace and saving the component successfully, on refreshing the code reverts to te default namespace i.e. "{!$Label.c.<label_name>}". Is this a known behavior or bug? Could not find any official documentation.
I am updating a custom task (Milestone Tasks) status to completed. It is throwing an exception:

Review the following errors
CCMI.TaskConfiguration: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0Z46000003E4s2EAC; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, CCMI.TaskConfiguration: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id a0Z46000003E95ZEAS; first error: SELF_REFERENCE_FROM_TRIGGER, Object (id = a0Z46000003E95Z) is currently in trigger CCMI.TaskConfiguration, therefore it cannot recursively update itself: [] (CCMI): [] (CCMI)

When I try to pull up the code I started with TaskConfiguration but it shows (hidden) in the dev console. Any help you can provide in trouble shooting this would be appreciated. 
Hello All,

I have a trigger which works fine for single record but does not work properly for while updating record thru data loader, can someone please help me to fix this.

Thanks
trigger NumberOfContRole1 on Opportunity (before update,before insert) {

    List<OpportunityContactRole> contactRolesList = [SELECT Id from OpportunityContactRole  where OpportunityId in :Trigger.new];
    system.debug('*****contactRolesList : ' + contactRolesList);
     List<Id> lstOcr = new  List<Id>();
     
    for(OpportunityContactRole OCR :contactRolesList){
        lstOcr.add(OCR.Id);
    }
    
    system.debug('*****lstOcr : ' + lstOcr);
    
    for(opportunity op : trigger.new){
        if(!lstOcr.isEmpty()){
            system.debug('*****lstOcr.size() : ' + lstOcr.size());
            op.NoOfContactRole__c= lstOcr.size();
            system.debug('*****op.NoOfContactRole__c: ' + op.NoOfContactRole__c);
        }
    } 
}

 
  • November 27, 2018
  • Like
  • 0