• anji punyamanthula
  • NEWBIE
  • 10 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 7
    Replies
Component-Markup:
<div class="slds-form-element__control">
<div class="uiInput uiInputDate uiInput--default uiInput--input uiInput--datetime">
             <label class="label inputLabel uiLabel-left form-element__label uiLabel">
              <span class="">{!v.customField.musqotmpm__startdate__c.Label}</span>
              <span class="required ">*</span>
      <aura:if isTrue="{!!empty(v.customField.musqotmpm__startdate__c.InlineHelpText)}">
     <lightning:helptext content="{!v.customField.musqotmpm__startdate__c.InlineHelpText}" />
         </aura:if>
           </label>
<lightning:input aura:id="date-StartDate" type="date" name="" label="" class="ltng-label-hide" value="{!v.sObject.Musqotmpm__StartDate__c}"                                                                                                                                                                                onchange="{!c.handlePeriod}" />
                                                                                    </div>
                                                                                </div>

Component:Js:
closeModal : function(component, event, helper) {
        component.set("v.hasErrors", false);
         $A.get('e.force:refreshView').fire();
        //$A.get("e.force:closeQuickAction").fire();
        //helper.readCustomField(component, event, helper);
        //document.location.reload(true);
        helper.hideModal(component, event, helper);
        //component.set('v.sObject', {});       
        if(!component.get('v.fromPlan')){
            window.history.back();
        }
},
    User-added image
I tried below code but i'm not getting o/p
Apex trigger:

trigger Rollup_Acc on Opportunity (After insert,After update,After delete,after undelete) {
    if(trigger.isinsert && trigger.isupdate && trigger.isdelete && trigger.isundelete){
    List<Account> accs=new List<Account>();
    Set<Id> ids=new Set<Id>();
    for(opportunity o:trigger.new){
        ids.add(o.AccountId);
        
    }
    decimal sum;
    for(Account acc :[select id,name,Amount__c,(select id,name,amount from opportunities ) from Account where id =:ids]){
        sum=0;
        for(opportunity op:acc.opportunities){
            sum+=op.Amount;
        }
        acc.AnnualRevenue=sum;
        accs.add(acc);
        
        
    }
   
    update accs;
    }
   
    
}
Below Example after taking Account als its throwing same error where i'm wrong let me know any one help in that 


trigger con_accname_error on Contact (before insert,before update) {
    for(contact c:trigger.new){
        if(c.Account==null){
            c.addError('pl enter account name');
        }
       
        
    }

}