Activity Forums Salesforce® Discussions Error in Salesforce Ligthning component

  • Error in Salesforce Ligthning component

    Posted by Vikas Kumar on December 20, 2016 at 11:59 am

    Hi all,

    trying to build a lightning component but flashing this error

    This page has an error. You might just need to refresh it.
    Assertion Failed!: Unknown controller action 'clickCreateCampingList' : undefined
    Failing descriptor: {ui$button$controller$press}

    CONTROLLER
    ({
    clickCreateCampingList: function(component, event, helper) {

    // Simplistic error checking
    var validCampinglist = true;

    // Name must not be blank
    var nameField = component.find("expname");
    var expname = nameField.get("v.value");
    if ($A.util.isEmpty(expname)){
    validExpense = false;
    nameField.set("v.errors", [{message:" name can't be blank."}]);
    }
    else {
    nameField.set("v.errors", null);
    }

    // ... hint: more error checking here ...

    // If we pass error checking, do some real work
    if(validCampinglist){
    // Create the new camping list
    var newitem = component.get("v.newitem");
    console.log("Create campingList: " + JSON.stringify(newitem));
    helper.createCampinglist(component, newitem);
    }
    }
    })

    Kumar replied 7 years, 9 months ago 2 Members · 1 Reply
  • 1 Reply
  • Kumar

    Member
    January 16, 2017 at 7:22 am

    Hi Vikas,

    Your controller code seems to be fine, please check your page. Maybe there is some minor formatting error associated with the button you made on the page.

     

Log In to reply.

Popular Salesforce Blogs

Popular Salesforce Videos