• Rahul-Sharma
  • NEWBIE
  • 52 Points
  • Member since 2017


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 10
    Replies
Hi, I have a question in Lightning component. What will happen when the <aura:attribute> tag in my lightning component keep on storing data from the controller? This is a scenario where client side controller is keep on pushing records to the component attribute using "component.push()" method. How much data can my <aura:attribute> can store? What will happen if the limit exceeds?

Thanks
I have translated some object field's picklist values in various languages (like Spanish, Portuguese etc.) using Translation Workbench in Sandbox. Now I want to migrate these translations to Production. How can I deploy these changes to Sandbox using ANT migration tool? 
Hi,
I need to know what will happen when a synchronous method called inside a fututre method. Will it run synchronously or it will also start its execution in asynchronous manner. Also please tell me what will happen if the called method is having any return type?
Thanks
Example:
@future
static void myFutureMethod(List<String> params) {
    // call synchronous method
    mySyncMethod(params);
}
Can we insert related record on child object using before insert trigger on parent object. How can I populate parent record id on child record alternatively in before insert trigger itself even it is not generated yet?
I want to generate child record related with parent record when new parent record is created. But I need to do this thing in before insert trigger only because some validations also need to be performed before inserting parent record. How can I achieve this?
Hi All,

I wrote a trigger in Opportunity to consolidated the order value of each FE and Tele Callers. for the same, I wrote a test class.
While running the Test class am getting coverage 82% in the sandbox. When I go for Validation in Production am getting 0% code Coverage Error.

Kindly help me to overcome this issue.

My Trigger:

trigger Cumulative_Calcuation_opp on Opportunity (Before Update) {
List<Target__C> Tglist= New List<Target__C>();
List<Target__C> Tglist1= New List<Target__C>();
Map<String,ID> Mapfield = New map<String,ID>();
Map<String,ID> MapTele = New map<String,ID>();
List<Incentive__c >lstInc =New list<Incentive__c >();
List<Incentive__c >lstInc1 =New list<Incentive__c >();
List <Cumulative__c> Cumlist= New list <Cumulative__c>();
List <Cumulative__c> Cumlist1= New list <Cumulative__c>();
list<Cumulative__c > lstcum = new list<Cumulative__c >(); 
list<Opportunity > opplist = new list<Opportunity >(); 
Set<String> setAllNames = new Set<String>();  
    
       For(Opportunity opp:Trigger.New){               
       Mapfield .put(opp.Field_Executive__c,opp.ID);MapTele.put(opp.Hidden_Owner_Name__c,opp.ID);} 
       setAllNames.addAll(Mapfield.keyset()); setAllNames.addAll(MapTele.keyset());             
for(target__C objTG : [SELECT ID, name FROM target__C WHERE Name in: setAllNames AND Active__c = True]) {
                if(Mapfield.containskey(objTG.Name)){
                    TGlist1.add(objTG);}
                if(MapTele.containskey(objTG.Name)){
                    TGlist.add(objTG);}
            }
            for(Opportunity opp: trigger.new ) { 
                    if(TGlist1.size()>0){if(opp.Field_Executive__c==TGlist1[0].NAme){
                                   opp.Target__C= TGlist1[0].ID; } }
                    IF(TGlist.size()>0){if(opp.Hidden_Owner_Name__c==TGlist[0].NAme){   
                                   opp.Telecaller__c=TGlist[0].ID;}}         
            If(opp.Telecaller__c!=Null && opp.Cumulative_Updated__c==False && opp.Work_Order_Created_Date__c!=Null ){
              Cumlist=[select ID,Target__c,Type1_Customer_Order_value_MPD__c,Type1_Customer_Order_Value_PD__c,Type2_Customer_Order_value_MPD__c,Type2_Customer_Order_value_PD__c,Type3_Customer_Order_value_MPD__c,Type3_Customer_Order_value_PD__c,Type4_Customer_Order_value_MPD__c,Type4_Customer_Order_value_PD__c,From_Date__c,To_Date__c from Cumulative__c where Target__c=:opp.Telecaller__c and  From_Date__c<=:opp.Work_Order_Created_Date__c and To_Date__c>=:opp.Work_Order_Created_Date__c];
                   if(Cumlist.size()>0){For(Cumulative__c Cum:Cumlist){lstInc = [select ID from Incentive__c where ID =:Opp.IncentiveSlab__c and Opp_Discount_To__c>=:opp.Discount__c]; 
                        If(lstInc.size()>0 ){If(Opp.Customer_Slab_Type__c=='Type 4'){           
                                Cum.Type4_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){Cum.Type2_Customer_Order_value_PD__c+= opp.Individual_Order_value__c; opp.Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){Cum.Type3_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_Value_PD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                             }} IF(lstInc.size()<=0 ){If(Opp.Customer_Slab_Type__c=='Type 4'){Cum.Type4_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){Cum.Type2_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){Cum.Type3_Customer_Order_value_MPD__c += opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            } Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.Cumulative_Updated__c=True;
                            } }lstcum .add(Cum);opplist.add(opp);} } } 
         If(opp.Target__C!=Null && opp.FE_Cumulative_Updated__c==False && opp.Work_Order_Created_Date__c!=Null ){               
              Cumlist1=[select ID,Target__c,Type1_Customer_Order_value_MPD__c,Type1_Customer_Order_Value_PD__c,Type2_Customer_Order_value_MPD__c,Type2_Customer_Order_value_PD__c,Type3_Customer_Order_value_MPD__c,Type3_Customer_Order_value_PD__c ,Type4_Customer_Order_value_MPD__c,Type4_Customer_Order_value_PD__c,From_Date__c,To_Date__c from Cumulative__c where Target__c=:opp.Target__C and From_Date__c<=:opp.Work_Order_Created_Date__c and To_Date__c>=:opp.Work_Order_Created_Date__c];
               if(Cumlist1.size()>0){For(Cumulative__c Cum:Cumlist1){ 
                       lstInc1 = [select ID from Incentive__c where ID =:Opp.IncentiveSlab__c and Opp_Discount_To__c>=:opp.Discount__c]; 
                        If(lstInc1.size()>0 ){If(Opp.Customer_Slab_Type__c=='Type 4'){ Cum.Type4_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.FE_Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){Cum.Type2_Customer_Order_value_PD__c+= opp.Individual_Order_value__c;opp.FE_Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){Cum.Type3_Customer_Order_value_PD__c += opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                             }Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_Value_PD__c+= opp.Individual_Order_value__c;   opp.FE_Cumulative_Updated__c=True;
                             }} IF(lstInc1.size()<=0 ){ If(Opp.Customer_Slab_Type__c=='Type 4'){Cum.Type4_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                        }Else IF(Opp.Customer_Slab_Type__c=='Type 2'){ Cum.Type2_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                        }Else IF(Opp.Customer_Slab_Type__c=='Type 3'){ Cum.Type3_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c; opp.FE_Cumulative_Updated__c=True;
                        } Else IF(Opp.Customer_Slab_Type__c=='Type 1'){Cum.Type1_Customer_Order_value_MPD__c+= opp.Individual_Order_value__c;opp.FE_Cumulative_Updated__c=True;}        
                        }lstcum .add(Cum); opplist.add(opp);
                      } } } 
                      update lstcum ; }}

My Test Class: 

@isTest(seealldata=true)
private class OI_Incentivetest{
    static testMethod void OI_Incentivetest(){
    
        GetInitialData Getdata = new GetInitialData();
        list<Account> acc = Getdata.getAccount();
        list<Product2> lstprod = Getdata.getProd();
        list<Opportunity> Opp = Getdata.getOpp();
        list<Pricebook2> lstPB = Getdata.getpricebook();
        list<Pricebookentry> lststdPbe = Getdata.getstdpbe();
        list<Pricebookentry> lstPbentry = new list<Pricebookentry>();
        list<attachment> lstattachment =  new list<attachment>();
        list<Payment__C> PMT = New List<payment__C>();
        insert lstprod; 
        Integer NofoDays = 0;
        list<Opportunity> lstOpp = new list<Opportunity>();
        list<IncentiveLineItem__c> lstIli= new list<IncentiveLineItem__c>();
         
        
        
        Incentive__c incindoor= new Incentive__c(Name='Indoor test', Active__c = true, Product_Type__c = 'Indoor', 
                Start_Date__c = date.newinstance(2014,12,25), Area__c = 'All India');
        insert incindoor;
        
         IncentiveLineItem__c inclitem = new IncentiveLineItem__c(Incentive__c = incindoor.id,Other_Mode__c=0.80 ,Customer_Mode__c='Type 3',Neft_Cash__c=0.75 , Discount_From__c=0,Discount_To__c=10,Field_Staff__c=1,Telesales__c=1,Combined__c=2);
        IncentiveLineItem__c inclitem1 = new IncentiveLineItem__c(Incentive__c = incindoor.id,Other_Mode__c=0.80 ,Customer_Mode__c='Type 4',Neft_Cash__c=0.75 , Discount_From__c=10,Discount_To__c=20,Field_Staff__c=0.5,Telesales__c=.05,Combined__c=1);
        insert inclitem;
        insert inclitem1;
        
        Incentive__c incPE= new Incentive__c(Name='PE test', Active__c = true, Product_Type__c = 'Play Equipment', Start_Date__c = date.newinstance(2014,12,25), Area__c = 'South');
        insert incPE;
        
       IncentiveLineItem__c incpeitem = new IncentiveLineItem__c(Incentive__c = incPE.id,Customer_Mode__c='Type 4' ,Other_Mode__c=0.80 ,Neft_Cash__c=0.75 ,Discount_From__c=0,Discount_To__c=10,Field_Staff__c=1,Telesales__c=1,Combined__c=2);
        IncentiveLineItem__c incpeitem1 = new IncentiveLineItem__c(Incentive__c = incPE.id,Customer_Mode__c='Type 3',Other_Mode__c=0.80 ,Neft_Cash__c=0.75 , Discount_From__c=10,Discount_To__c=20,Field_Staff__c=0.5,Telesales__c=.05,Combined__c=1);
        insert incpeitem;
        insert incpeitem1; 

        Integer indexvalue = 0;
        if(lstprod.size()>0){
            for(pricebookentry irow :lststdPbe){
                irow.product2id = lstprod[indexvalue].id;
                indexvalue++;
            }
        }
        
        insert lststdPbe;
        insert lstPB; 

        if(lstprod.size()>0)  {
            for(pricebook2 irow :lstPB) {
                for(Product2 ipro : lstprod ){
                    Pricebookentry pbe = new Pricebookentry();
                    pbe.product2id = ipro.id;
                    pbe.pricebook2id = irow.id;
                    pbe.unitprice = 3000;
                    pbe.isActive = true;
                    lstPbentry.add(pbe);    
                }
            }
        }
        
        insert lstPbentry;
        insert acc[0];
      
        Opp[0].accountId = acc[0].id;
        insert Opp[0]; 
        
        Contact con= New Contact(FirstName='Shakila',LastName='Test',AccountID=acc[0].id);
    insert con;
        
        //Test.startTest();
        
         lstPB[0].Incentive_Slab__c=incPE.ID;
         update lstPB[0];
        
       
        
        Opp[0].Pricebook2Id = lstPB[0].id;
        opp[0].IncentiveSlab__c= lstPB[0].Incentive_Slab__c;
        opp[0].Field_Executive__c='Raman.A';
        update Opp[0];
        
        
        
        OpportunityLineItem OL = new OpportunityLineItem(opportunityid=Opp[0].id, Quantity=1, unitprice=8000,  
        pricebookentryid=lstPbentry[0].id);
        insert OL;  
        
        Quote Q = new Quote();
        Q.Name = 'QuoteTest';
        Q.OpportunityId = Opp[0].id; 
        Q.Quote_Count__c = 77;
        Q.Approved__c = true;
        Q.Quote_Number__c ='00000710';
        Q.Quotation_Date__c = date.newinstance(2018,7,12);
        Q.Pricebook2Id = lstPB[0].id;
         Q.Tax_Classification__c='IGST';
        insert Q;
        
        Quotelineitem QL = new Quotelineitem(quoteId=Q.id, Quantity =1, Unitprice=8000,pricebookentryid=lstPbentry[0].id);
        insert QL; 
        
         
        Q.Approved__c=True;
        Update Q;
        
        Opp[0].SyncedQuoteId = Q.id;
        update Opp[0];
       
        Opp[0].Stagename = 'Closed Won';
        update Opp[0];
        
        Project__c Proj = new Project__c(name='TestProj', Opportunity__c = Opp[0].id,Contact__c=con.ID, Quote__c = Q.id, Project_Type__c = 'New PE', Date_of_Installation__c = date.newinstance(2018,6,22),
        Nature_of_Case__c ='No Adv, Dspch & Erection Pending',Customer_Name__c=acc[0].id,Special_Instructions__c ='Test for Work order Pdf to be generated');    
        
        insert Proj;
        
        Payment__c pay0 = new Payment__c( Amount__c = 8400, Date__c = date.newinstance(2018,6,22), Mode_of_Payment__c = 'Cash',Opportunity__c = Opp[0].id,
        Project__C=proj.ID, Payment_Type__c ='Advance');
        insert pay0;
      
        Payment__c pay = new Payment__c( Amount__c = 8400, Date__c = date.newinstance(2018,6,22), Mode_of_Payment__c = 'Cash',Opportunity__c = Opp[0].id,
        Project__C=proj.ID, Payment_Type__c ='Full Pay');
        insert pay;
        
        opp[0].IncentiveSlab__c= lstPB[0].Incentive_Slab__c;
       
        update Opp[0];
        
        NofoDays= Proj.Date_of_Installation__c .daysBetween(pay.Date__c);
         If(NofoDays<=0)
          NofoDays=0;
              
           OPP[0].No_of_Days__c=NofoDays;
           update Opp[0];
         
         If(opp[0].IncentiveSlab__c!=Null  && Opp[0].Customer_Slab_Type__c!='Type 4')
            
            {            
              
          lstIli = [select id,Other_Mode__c,Neft_Cash__c, Payment_Term_From_Days__c, Payment_Term_To_Days__c 
                        from IncentiveLineItem__c where Incentive__c = : opp[0].IncentiveSlab__c and 
                        Payment_Term_To_Days__c >=: NofoDays and Customer_Mode__c=:opp[0].Customer_Slab_Type__c];

        
            }Else If(opp[0].IncentiveSlab__c!=Null  && Opp[0].Customer_Slab_Type__c=='Type 4')
            {          
              
       
        
                     
            PMT=[select ID from Payment__c  where Project__c=:pay.Project__C and Payment_Type__c='Advance'];
            IF(PMT.size()>0 && Opp[0].Customer_Slab_Type__c=='Type 4')
            {
              lstIli = [select id,Other_Mode__c,Neft_Cash__c, Payment_Term_From_Days__c, Payment_Term_To_Days__c from IncentiveLineItem__c where Incentive__c = : opp[0].IncentiveSlab__c and Discount_From__c<=:PMT[0].Advance_Payment__c and  Discount_To__c>=:PMT[0].Advance_Payment__c and Payment_Term_To_Days__c >=: NofoDays and  Customer_Mode__c=:opp[0].Customer_Slab_Type__c];
            
            }
             Else IF(PMT.size()<=0 && Opp[0].Customer_Slab_Type__c=='Type 4' && opp[0].No_Advance__c==True && NofoDays<=0)
            {
              lstIli = [select id,Other_Mode__c,Neft_Cash__c, Payment_Term_From_Days__c, Payment_Term_To_Days__c from IncentiveLineItem__c where Incentive__c = : opp[0].IncentiveSlab__c and Discount_From__c<=:PMT[0].Advance_Payment__c and  Discount_To__c>=:PMT[0].Advance_Payment__c and Payment_Term_To_Days__c >=: NofoDays and  Customer_Mode__c=:opp[0].Customer_Slab_Type__c];
            
            }
            Else IF(PMT.size()<=0 && Opp[0].Customer_Slab_Type__c=='Type 4' && opp[0].No_Advance__c==True && NofoDays>0)
            {
              lstIli = [select id,Other_Mode__c,Neft_Cash__c, Payment_Term_From_Days__c, Payment_Term_To_Days__c from IncentiveLineItem__c where Incentive__c = : opp[0].IncentiveSlab__c and No_Advance__c=:opp[0].No_Advance__c and Payment_Term_To_Days__c >=: NofoDays and  Customer_Mode__c=:opp[0].Customer_Slab_Type__c];
            
            }
            
            }
            
          if (lstIli.size() > 0) {      
              if (pay.Payment_Mode_Type__c.contains('Cash') || pay.Payment_Mode_Type__c.contains('NEFT'))
              {
                    opp[0].NewIncentivePercentage__c = lstIli[0].Neft_Cash__c;
                     opp[0].No_of_Days__c=NofoDays;
                    }
                else if (pay.Payment_Mode_Type__c.contains('Others'))
                {
                      opp[0].NewIncentivePercentage__c = lstIli[0].Other_Mode__c;
                      opp[0].No_of_Days__c=NofoDays;
                     }
               else if (lstIli.size() < 0) 
               {              
                     opp[0].NewIncentivePercentage__c =0;
                     opp[0].No_of_Days__c=NofoDays;
                }
                list<Opportunity> lstOpp1 = new list<Opportunity>();
                lstOpp1 .add( opp[0]);
                update lstOpp1 ;   
       
           } 
           
           
        Payment__c pay2 = new Payment__c( Amount__c = 8400, Date__c = date.newinstance(2018,6,22), Mode_of_Payment__c = 'Cash',Opportunity__c = Opp[0].id,
        Project__C=proj.ID, Payment_Type__c ='Advance');
        insert pay2;
           
        pay2.Date__c = date.newinstance(2018,6,29);
        Update Pay2;
        
         Target__c  TC= NEw Target__c (Name='Raman.A',Out_Standing_Amount__c=10000,Active__c=True,Target_Amount__c=700000);
        Insert TC; 
        
        Integer numberOfDays;
        Cumulative__c CTC= New Cumulative__c (From_Date__c=Date.today(),
        To_Date__c=date.newinstance(2018,7,30),Target__c=TC.ID);
        
        insert CTC;  
        
        opp[0].Field_Executive__c='Raman.A';
        update Opp[0];
        
        CTC.Type1_Customer_Order_Value_PD__c=1000;
        update CTC;
        
           opp[0].Cumulative_Updated__c=True;
          update Opp[0];
           
       
   }  
   
}



Thanks
  
Hi,
I need to know what will happen when a synchronous method called inside a fututre method. Will it run synchronously or it will also start its execution in asynchronous manner. Also please tell me what will happen if the called method is having any return type?
Thanks
Example:
@future
static void myFutureMethod(List<String> params) {
    // call synchronous method
    mySyncMethod(params);
}
Can we insert related record on child object using before insert trigger on parent object. How can I populate parent record id on child record alternatively in before insert trigger itself even it is not generated yet?
I want to generate child record related with parent record when new parent record is created. But I need to do this thing in before insert trigger only because some validations also need to be performed before inserting parent record. How can I achieve this?
What is a method for adding content to Salesforce CRM content? (2 answers)
a.            Attachments
b.            Chatter files
c.             Libraries
d.            Documents
 
I created a new class 'RemindOpptyOwners' per the Trailhead tutorial on Apex Scheduler, but the code will not compile, because
 
'Variable does not exist: TaskUtils'
Here is the code I have:
 
global class RemindOpptyOwners implements Schedulable {

    global void execute(SchedulableContext ctx) {

        List<Opportunity> opptys = [SELECT Id, Name, OwnerId, CloseDate
            FROM Opportunity
            WHERE IsClosed = False AND
            CloseDate < TODAY];
        // Create a task for each opportunity in the list
        TaskUtils.remindOwners(opptys);
    }
}

I transcribed this code at first, but then copied and pasted directly into the Dev console and got the same error. Why is TaskUtils not being recognized?

API Version: 37.0
 
Challenge - Create a form to enter new items and display the list of items entered. To make our camping list look more appealing, change the campingHeader component to use the SLDS. Similar to the unit, style the Camping List H1 inside the slds-page-header. Modify the campingList component to contain an input form and an iteration of campingListItem components for displaying the items entered.
The component requires an attribute named items with the type of an array of camping item custom objects.
The component requires an attribute named newItem of type Camping_Item__c with default quantity and price values of 0.
The component displays the Name, Quantity, Price, and Packed form fields with the appropriate input component types and values from the newItem attribute.
The JavaScript controller checks to ensure that the Name, Quantity and Price values submitted are not null.
If the form is valid, the JavaScript controller pushes the newItem onto the array of existing items, triggers the notification that the items value provider has changed, and resets the newItem value provider with a blank sObjectType of Camping_Item__c.


My answer - 
<aura:component >
<aura:attribute name="items" type="Camping_Item__c[]"/>
<aura:attribute name="newitem" type="Camping_Item__c[]"  default="{ 'sobjectType': 'Camping_Item__c',
                   'Quantity__c'=0, 'Price__c'=0}"/>
 <p>Name:
        <ui:inputText value="{!v.newitem.name}"/>
    </p>    
  <p>Packed:
        <ui:inputCheckbox value="{!v.newitem.Packed__c}"/>
     
    </p>    
  <p>Price:
        <ui:inputCurrency value="{!v.newitem.Price__c}"/>
    </p>
    <p>Quantity:
        <ui:inputNumber value="{!v.newitem.Quantity__c}"/>
    </p>
</aura:component>


Error -

Challenge Not yet complete... here's what's wrong: 
The campingList component isn't iterating the array of 'items' and creating 'campingListItem' components.

Please share the correct solution.
Hi, I am having trouble with the "Attributes and Expressions" module from trailhead.

Here is the challenge:
Create a Lightning Component to display a single item for your packing list.
  • Create a component called campingListItem that displays the name (ui:outputText) and the three custom fields using the appropriate output components.
  • Add an attribute named 'item' for type Camping_Item__c.
I created an component named campingListItem and this is the code:
<aura:component >
    <aura:attribute name="item" type="<my_domain>__Camping_Item__c"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    <ui:outputCheckbox value="{!v.item.<my_domain>__Packed__c}"/>
    <ui:outputCurrency  value="{!v.item.<my_domain>__Price__c}"/>
    <ui:outputNumber value="{!v.item.<my_domain>__Quantity__c}"/>
</aura:component>

The error that I am getting is: "Challenge Not yet complete... here's what's wrong: 
The packingListItem Lightning Component's attribute tag doesn't exist or its attributes are not set correctly."

With this, I tried to create another component, with the name "packingListItem", but It didn't work.

Can anyone help me?

Thanks,
Hi,
What’s the maximum batch size in a single trigger execution ?
Hi,
Can any one help me with an example of a standard object that’s also junction object in salesforce.

Thanks in Advance

i not understanding usage of junction object .

Please explain usage and how to create junction object with a example