Aura Methods in Lightning Component | Parent to Child Communication | Understanding Layouts - Day 7

แชร์
ฝัง
  • เผยแพร่เมื่อ 8 ต.ค. 2024
  • Welcome everyone to the Day 7 of Lightning Component Development Sessions. This is my initiative to help the Salesforce Community in learning Lightning which I believe is the future of Salesforce. Allow me to take you through 15 sessions long Lightning journey, I hope you all learn something from this free training and help others as well.
    Enrol in my full hands-on course on LWC Development - www.udemy.com/...
    Day 8 Session: • Lightning Data Service...
    Day 6 Session: • Firing and Handling Co...
    All Sessions in this series
    • Lightning Salesforce L...
    About Me:
    Manish is a highly experienced Software Developer who has worked in big tech companies like Google and Salesforce. Presently he is associated with Amazon as SDE 2.
    He is on his journey to make everyone interview ready for the big 5 FAANG (Facebook, Amazon, Apple, Netflix, Google) companies. Check out his channel for comprehensive tutorials on various technologies and mock google/amazon interviews.
    🎓 My courses on Udemy (discounted links below):
    📹 The Complete Salesforce Development Course - www.udemy.com/...
    📹 The Ultimate Hands-On Lightning Web Component - www.udemy.com/...
    📹 The Practical Guide to SFDX and Salesforce CLI - www.udemy.com/...
    Follow SFDCFacts Academy:
    Website: sfdcfacts.com
    Facebook: / sfdcfacts
    Instagram: / sfdcfacts
    LinkedIn: / sfdcfacts
    Connect with Manish:
    / manish-choudhary
    Twitter: / sfdcfacts
    Become a patron and support my work here: / sfdcfacts
    #salesforce #lightning #day7 #lwc #salesforcelightning #auramethod

ความคิดเห็น • 36

  • @rishavk404
    @rishavk404 5 ปีที่แล้ว +2

    Thanks brother...

  • @parulgaur7536
    @parulgaur7536 2 ปีที่แล้ว

    Thank you Manish for such a great learning videos

    • @imtiyazahmed5542
      @imtiyazahmed5542 2 ปีที่แล้ว

      Hi
      i have query in CarTile component if you understand properly can you expalin it to me or share the code file.

  • @rahulkumbhare5454
    @rahulkumbhare5454 2 ปีที่แล้ว

    Hi Manish, thanks for the video series. Can you tell us how can we get the data for cars? We will need to upload the data related to Car object to move ahead in the series.

  • @ayushkhanna1996
    @ayushkhanna1996 4 ปีที่แล้ว

    Excellent Video. And very well explained.

  • @jthathapudi
    @jthathapudi 6 ปีที่แล้ว +1

    appreciate your efforts....

  • @ajaykonathala
    @ajaykonathala 5 ปีที่แล้ว +1

    Hi Manish,
    Can u please share the link where i can find this code
    .
    I searched in the SFDC facts website and there is no such section or where i can find the complete code.
    Can you please provide the section name where it is available on the website.

  • @lakshmiradhakrishnan6328
    @lakshmiradhakrishnan6328 5 ปีที่แล้ว +1

    Hi Manish,
    First of all I would like to thank you for the Lightning components video tutorials. It's extremely helpful.
    Had a doubt about Day 7 code.
    After doing about half day's code, on trying to execute I'm getting this error and seem to be stuck on it. Can you please guide.
    This page has an error. You might just need to refresh it.
    Action failed: c:CarSearchResult$controller$doInit [actions is not defined]
    Failing descriptor: {c:CarSearchResult$controller$doInit}
    Regards,
    Lakshmi.

    • @SFDCFacts
      @SFDCFacts  5 ปีที่แล้ว +1

      It looks like you have not defined action variable before using it.

    • @lakshmiradhakrishnan6328
      @lakshmiradhakrishnan6328 5 ปีที่แล้ว

      Hi Manish, figured out the problem. It was in BaseHelper.js. Thank you for the pointer.

    • @kritikakerhalkar9326
      @kritikakerhalkar9326 5 ปีที่แล้ว

      Hi Lakshmi can you please let me know the solution. I am getting the same error.

  • @rashmisharmaa.k.apareek4305
    @rashmisharmaa.k.apareek4305 4 ปีที่แล้ว

    Thanks for your videos but we are stuck.
    We are not able to find the code and I'm half way. I'm stuck on day 7. Kindly suggest if there is any other way to access Rent a Car app code. The link provided by you is not working. We all need that code. Guide please

  • @sivareddyn394
    @sivareddyn394 ปีที่แล้ว

    Hi manish i have one question how to in sert a data in the url part that was a custom field that is Picture__c that is a url field

  • @snehachoudary
    @snehachoudary 5 ปีที่แล้ว +2

    Hi All,
    Can u please share the link where i can find this code

  • @manjuvenkat2019
    @manjuvenkat2019 4 ปีที่แล้ว

    Hi Manish,
    There are two things I am really struggling with.
    1. The lightning select tag. The variant is 'label-hidden' and the label is hidden but there is a misalignment in the layout between the drop down and the Search Cars button..it's silly but I am not able to figure it out.
    2. Cars zip file. I uploaded and tried to read it just like you have shown but the images do not appear. The code is exactly like yours but it just doesn't work. Has anything changed?

  • @manishshaw2393
    @manishshaw2393 3 ปีที่แล้ว

    Like we passed the car in the CarTile from CarSearchResult to CarTile .... similarly..why cant we pass CarTypeId from CarSearch to CarSearchResult directly.....why to use this AURA method?

  • @hemanthtanguturi9563
    @hemanthtanguturi9563 6 ปีที่แล้ว +1

    Hi manish, What is the data type of picture__c field which is been used in cartile?

    • @dimitrishat8659
      @dimitrishat8659 5 ปีที่แล้ว

      it is a look up to the object "Picture__c"

    • @susmithaparimi4550
      @susmithaparimi4550 ปีที่แล้ว

      picture field's datatype is URL and static resource link is added as values

  • @Rajbusy_bee
    @Rajbusy_bee 3 ปีที่แล้ว

    Hi all I am getting below error while loading the page. Please help.
    Error:
    Unable to find action 'getCars' on the controller of c:CarSearchResult
    Failing descriptor: {c:CarSearchResult}.. not able to guess till where the component is executing

    • @susmithaparimi4550
      @susmithaparimi4550 ปีที่แล้ว

      check your apex controller whether the getCars method is defined properly or not.

  • @hanithareddy8064
    @hanithareddy8064 6 ปีที่แล้ว +1

    hi My CarserachResult cmp is not working (not giving the expected output of car names of selected picklist value)
    Cmp:











    {!car.Name}




    no permission







    Js Controller:
    ({
    doinit : function(component, event, helper) {
    helper.onsearch(component, helper);

    }
    })
    helper:
    ({
    onsearch : function(component, helper) {
    var action = component.get("c.getcars");
    action.setParams({
    "carTpyeId" : component.get("v.carTpyeId")
    });
    action.setCallback(this, function(response) {
    var state = response.getState();
    if (component.isValid() && state === "SUCCESS") {
    component.set("v.Cars", response.getReturnValue());

    component.set("v.CarFound", true);
    }
    });
    $A.enqueueAction(action);


    },
    /*helper.callserver(component,"c.getcars",
    function(response){
    if(response.length >0 ){
    component.set("v.Cars", response);
    component.set("v.CarFound", true);

    }
    else{
    component.set("v.CarFound", false);
    }
    },{
    carTpyeId : 'a0H6F00000Psx7ZUAR'
    });
    },*/
    })
    Apex:
    public class CarSerachcontroller {
    @AuraEnabled
    public static Listgetcars(String carTpyeId){
    if(carTpyeId.equalsIgnoreCase('')){
    return [Select Id,Name,Picture__c,Contact__r.Name ,Geolocation__c from Car__c where Available_For_Rent__c= true];
    }
    else{
    return [Select Id,Name,Picture__c,Contact__r.Name ,Geolocation__c from Car__c where Car_Type__c =:carTpyeId AND Available_For_Rent__c= true];
    }
    }
    }
    not giving the expected output of car names of selected picklist value)

    • @susmithaparimi4550
      @susmithaparimi4550 ปีที่แล้ว

      From CarSearchResult helper , trying to set the params with the attribute defined in markup which doesn't have any cartype Id (before getting it from CarSearch component, here we need to hard code the cartype Id)
      var carTpyeId = 'any related Id';
      action.setParams({ "carTpyeId" : carTpyeId });

  • @preetamdubey5478
    @preetamdubey5478 4 ปีที่แล้ว

    NEED HELP-
    This page has an error. You might just need to refresh it.
    Action failed: Preetam:CarSearchResult$controller$doSearch [Cannot read property 'callServer' of undefined]
    Failing descriptor: {Preetam:CarSearchResult$controller$doSearch}
    CONTROLLER==========================================================
    ({
    doInit : function(component, event, helper) {
    helper.onSearch(component, event, helper);
    },
    doSearch: function(component, event, helper) {
    var params = event.getParam('arguments');
    if(params){

    component.set("v.carTypeIdComponent" ,params.carTypeId);
    console.log(component.get("v.carTypeIdComponent"));
    helper.onSearch(component, helper);

    }
    },
    })
    HELPER=========================================================
    ({
    onSearch : function(component, event, helper) {
    console.log('response-->1');
    console.log('response-->1COMPONENT=='+component);

    helper.callServer(

    component,"c.getCars",function(response){
    console.log(response);
    if(response.length>0) {
    console.log('response-->'+response);
    component.set("v.cars",response);
    component.set("v.carFound",true);
    }else{component.set("v.carFound",false);}
    },

    {carTypeId : component.get("v.carTypeIdComponent")
    //carTypeId : 'a0l0I00000EC4ArQAL'
    }
    );
    }
    })
    BASE=====================
    ({
    callServer : function(component,method,callback,params) {
    console.log('AM I-->1');
    var action = component.get(method);
    if(params){
    action.setParams(params)
    }

    action.setCallback(this,function(response){
    var state= response.getState();
    console.log('state--------->'+state);
    if(state==="SUCCESS"){
    callback.call(this,response.getReturnValue());
    console.log('response.getReturnValue()--------->'+response.getReturnValue());

    }
    else if(state==="ERROR"){
    var error = response.getError();
    if(error){
    console.log("Errors:",error);
    if(error[0] && error[0].message){
    throw new Error("Error" +error[0].message);
    }

    }else{
    alert("Unknown ERROR --FROM CAR SEARCH FORM HELPER ");
    }

    }
    })
    $A.enqueueAction(action);


    },
    })

  • @imtiyazahmed5542
    @imtiyazahmed5542 2 ปีที่แล้ว

    How we put the image in Picture__c and used in cartile component?.
    Anyone have any idea pls tell

    • @susmithaparimi4550
      @susmithaparimi4550 ปีที่แล้ว

      try to upload the image in static resources and use the URL in Picture__c field (data type of picture field should be URL)