Posts

Showing posts from January, 2020

Home

Image
Welcome to my Blog. My name is Vinayak.  I am a PD1 Certified Salesforce Developer. My Works: https://github.com/vinayaksfdc

Navigate

Image
Navigate To Lightning Component Navigation_ex.cmp <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:hasPageReference,lightning:isUrlAddressable"                 access="global" >     <lightning:navigation aura:id="navigation" />     <lightning:button label="Navigation" title="NavigationRec" onclick="{!c.NavigationRec}" /> </aura:component> JS ({     NavigationRec : function(component, event, helper) {         var pageReference = component.find("navigation");         var pageReferenceNav = {                "type": "standard__component",             "attributes": {               ...

Navigate to Record Page

Image
Navigation_ex.Cmp <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:hasPageReference,lightning:isUrlAddressable"                  access="global" >          <lightning:navigation aura:id="navigate" />     <lightning:button label="Navigation" title="NavigationRec" onclick="{!c.NavigationRec}" />      </aura:component> Js ({    NavigationRec : function(component, event, helper) {                  var pageReference = component.find("navigate");                  var pageReferenceNav = {                 "type": "standard__recordPage",       ...

Navigate to Related List

Image
Navigation_ex <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:hasPageReference,lightning:isUrlAddressable"                  access="global" >          <lightning:navigation aura:id="navigate" />          <lightning:button label="Cases Lightning Related List" onclick="{!c.gotoRelatedListCase}"                        variant="brand" />            <lightning:button label="Contact Lightning Related List" onclick="{!c.gotoRelatedListCon}"                        variant="brand" />       <lightning:button label="Opportunities Ligh...

Navigate To ListView

Image
List View Navigation_ex.cmp <aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:hasPageReference,lightning:isUrlAddressable"                  access="global" >     <lightning:navigation aura:id="navigate" />     <lightning:button label="Lightning Navigate" onclick="{!c.navigate}"                       variant="brand"/> </aura:component> JS ({     navigate : function(component, event, helper) {         var nagigateLightning = component.find('navigate');         var pageReference = {             type: 'standard__objectPage',             attributes: {     ...
Image
OverLay OverLay.cmp <aura:component implements="flexipage:availableForAllPageTypes,force:hasRecordId">     <lightning:overlayLibrary aura:id="overlayLib"/>     <lightning:button variant="brand"  value="Create Modal" label="Show Modal" onclick="{!c.handleShowModal}"/>     {!v.body} </aura:component> OverLay.Js ({     handleShowModal : function(component, event, helper) {         component.find('overlayLib').showCustomModal({             header: "Application Confirmation",             body: 'This is Test',             footer: 'Footer',             showCloseButton: true,             closeCallback: function() {                 alert('You closed the alert!');           ...
Image
Inheritance BaseComponent.cmp <aura:component extensible="true" controller="AccountUtil" >     <aura:attribute name="message" type="String" default="Value from Parent"/>     {!v.body} </aura:component> Helper ({     getDataFromServer : function(component, method, callback, params )     {         alert('helper is execting');         var action = component.get(method);         if (params) {             action.setParams(params);         }         action.setCallback(this,function(response)         {             var state = response.getState();             if (state === "SUCCESS") {                 callback.call(this,response.getReturnValue());     ...
Image
Aura Method AuraMethodparent_ex <aura:component >     <aura:attribute name="message" type="String"                     default="------ Hello From Parent -----"/>     <c:AuraMethodchild_ex aura:id="childComponent"/>     <div class="slds-m-around_xx-large">         <lightning:button variant="brand" label="Call Aura Method"                           onclick="{!c.callAuraMethod}" />         <BR></BR> <BR></BR>         <p>{!v.message}</p>     </div> </aura:component> JS: ({      callAuraMethod : function(component, event, helper) {             var childCmp = component.find("childComponent");             var...
Image
Application Event Event: secondevt <aura:event type="APPLICATION" description="Event template" >     <aura:attribute name="accName" type="String"/> </aura:event> child1.cmp <aura:component >     <aura:attribute name="name" type="string" default="vinayak" />   <!---Registering Event-->       <aura:registerEvent name="one" type="c:secondEvent" />     <div class="box">         <lightning:button label="change" onclick="{!c.call}" />     </div> </aura:component> Js  ({     call : function(component, event, helper) {         //getting the value from UI         var name=component.get('v.name');         console.log(name);         var evt=$A.get("e.c:secondEvent");         evt.setParams({"accName":name})...

Showing Error from ServerSide controller in UI using Lightning Components

Image
Error In Server Side Controller --- Error Exception happendInvalid field Count for AggregateResult ServerSide Controller public class Agg_exam_opp {      @AuraEnabled     public Static list<aggregateresult> aggEx()     {         try{             list<aggregateresult> aggres=[SELECT StageName Name,Count(Id) Cnt FROM Opportunity GROUP BY Stagename];              for(aggregateresult agg:aggres)             {                 System.debug('avgval'+agg.get('Name'));                 System.debug('conval'+agg.get('Count'));     ...