Activity Forums Salesforce Questions and Answers Error in Salesforce Ligthning component

  • Vikas Kumar

    Member
    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

    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.

     

Viewing 1 - 2 of 2 posts

Log in to reply.

Original Post
0 of 0 posts June 2018
Now