0% found this document useful (0 votes)
81 views3 pages

Lightning Batch 39

LTG NOTE FOR SALESFORCE

Uploaded by

glvibes98
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
81 views3 pages

Lightning Batch 39

LTG NOTE FOR SALESFORCE

Uploaded by

glvibes98
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 3

lightning component .....................

1st class--------------------
tejuworld component=======
<aura:component >
<h1 style="color:blue;fontsize:30px"><center>Welcome to Salesforce
Start</center></h1>
<h1
style="color:orange"><center>------------------------------------------------------
-------------------</center></h1>
<p>
<h1 style="color:green;fontsize:40px"> <p> <center>*****HERE WE CAN GIVE
ONLINE TRAINING AND PLACEMENTS***</center> </p><br/></h1>
<h1 style="color:Brown;fontsize:100px">
<center>
<p> 1.Salesforce Admin </p><br/>
<p> 2.Salesforce CPQ </p><br/>
<p> 3.salesforce Developer </p><br/>
<p> 4.salesforce Lightning </p><br/>
<p> 5.salesforce Aura </p><br/>
<p> 6.LigtninG Web Component </p><br/>
<p>><h1
style="color:red"><center>---------------------------------------------------------
----------------</center></h1></p>

<p> <h1 style="color:orange;fontsize:90px"><center>Call are


Whatsup</center></h1></p>
<p> <h1
style="color:orange;fontsize:90px"><center>9393934143</center></h1></p>
</center>
</h1>

</p>
</aura:component>
///////////////////////////////////////////////////////////////////////////////////
/////////////////////////////////////////////////////////////////////////
tejuworld test=======
<aura:application extends="force:slds">
<c:TejuWorld></c:TejuWorld>

</aura:application>
===================================================================================
========
parent component and child component:
<aura:component>
<aura:attribute name="pname" type="string" default="Chiru"></aura:attribute>
<div class="slds-box">
From parent component Message:{!v.pname}
</div>

<div class="slds-box">
<c:LTGchildcharan cname="RamCharan"></c:LTGchildcharan>

</div>

</aura:component>

===================================================
<aura:component>
<aura:attribute name="cname" type="string" default="Charan"></aura:attribute>
<div class="slds-box">
message from childcomponent charan : {!v.cname}

</div>
</aura:component>

====================================================================
dispaly contact:::::::::::::::::::::::::::apex class
public class CntcController {
@AuraEnabled
public static List<Contact> getContacts(string accId){
List<Contact> lstCons = new List<Contact>();
try{
lstCons = [select id, lastname, phone, email from contact WHERE
AccountId=:accId];
}catch(Exception e){
throw new AuraHandledException(e.getMessage());
}
return lstCons;
}
}
============================component________________________
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId"
controller="CntcController">
<aura:attribute name="lstCons" type="List" />
<aura:attribute name="recordId" type="String"></aura:attribute>

<!-- handler -->


<aura:handler name="init" value="{!this}" action="{!c.Contactdisplay}"/>

<!-- htmlmarkup -->


RecordId : {!V.recordId}
<div class="slds-grid slds-wrap">
<aura:iteration items="{!V.lstCons}" var="con">
<div class="slds-p-around_medium slds-col slds-size_1-of-3">
<lightning:card title="{!con.Name}" iconName="standard:Account" footer="{!
Acc.Email}">
<aura:set attribute="actions">
<lightning:button label="view Account" variant="brand"/>
</aura:set>
<p class="slds-p-horizantal_small">
{!con.Title} &nbsp;&nbsp;&nbsp; {!con.Phone} &nbsp;&nbsp;&nbsp;
</p>

</lightning:card>

</div>
</aura:iteration>
</div>
</aura:component>
======================================js
controller_____________________________________
({
Contactdisplay : function(component, event, helper) {
var action = component.get("c.getContacts");
//action set params
action.setParams({
accId: component.get('v.recordId')
});
action.setCallback(this, function (responce){
var status= response.getState();
alert('Status :::'+status);
if(status ==="SUCCESS"){
var responseMsg = response.getReturnValue();
console.log(JSON.stringify(responseMsg));
component.set('v.lstCons', responseMsg);
} else if(state === "INCOMPLETE"){
}else if(state ==="ERROR"){
var errors = response.getError();
if(errors){
if(errors[0] && errors[0].message){
console.log('Error message:'+errors[0].message);

}
}

}else{
console.log("Unknownerror");

});
$A.enqueueAction(action);
}
})
=========================++++++++++++++++++++++++application of cntcdisplay
<aura:application >
<c:Cntctcontrollercmp></c:Cntctcontrollercmp>

</aura:application>

You might also like