You need to sign in to do that
Don't have an account?
Venkatesh
Assertion Failed!: Unable to get value for key.
Hi
I am new to lightning, I am trying to create a lightning app which have to do action(replaceing URL hacking).
when i am trying to execute the application it showing an error as shown below.
"This page has an error. You might just need to refresh it. Assertion Failed!: Unable to get value for key 'AIO.doInit'. No value provider was found for 'AIO'. : false Failing descriptor: {AIO:myFirstURLHACKApp}"
Here AIO is my name space.
I am new to lightning, I am trying to create a lightning app which have to do action(replaceing URL hacking).
when i am trying to execute the application it showing an error as shown below.
"This page has an error. You might just need to refresh it. Assertion Failed!: Unable to get value for key 'AIO.doInit'. No value provider was found for 'AIO'. : false Failing descriptor: {AIO:myFirstURLHACKApp}"
Here AIO is my name space.
<aura:component controller="AIO.AccountFormByIDController" >
<aura:attribute name="accGetID" type="String"/>
<aura:attribute name="ac" type="Account"/>
<aura:handler name="init" value="{!this}" action="{!AIO.doInit}" />
<ui:inputText label="Account Name" value="{!v.ac.Name}"/>
<ui:inputText label="Type" value="{!v.ac.Type}"/>
<ui:inputText label="Industry" value="{!v.ac.Industry}"/>
</aura:component>
controller:
({
doInit : function(component, event) {
alert('Test');
var action = component.get("AIO.find_AccById");
action.setParams({ "get_accountid": component.get("v.accGetID") });
action.setCallback( this, function(response) {
var state = response.getState();
if (state === "SUCCESS") {
component.set("v.ac", response.getReturnValue());
console.log(response.getReturnValue());
}
});
$A.enqueueAction(action);
},
})
But this time it showing different error as,
This page has an error. You might just need to refresh it. Assertion Failed!: no client action by name {!doInit} : false Failing descriptor: {AIO:myFirstURLHACKApp}.
This is my apex controller.
public with sharing class AccountFormByIDController {
@AuraEnabled
public static Account find_AccById(Id get_accountid) {
system.debug('entered into apex');
if(get_accountid != null ) {
system.debug('entered into if in apex');
return [SELECT Id, Name, Type, Industry from Account where ID = :get_accountid];
}
else{
system.debug('entered into else in apex');
return [SELECT ID, Name, Type, Industry from Account LIMIT 1];
}
}
}
Let me inform if it helps you and kindly mark it best answer if it helps you so it make proper solution for others
thanks
http://sfdcmonkey.com (http://sfdcmonkey.com )
Unable to find 'doInit' on 'compound://AIO.AccountFormByID'. Failing descriptor: {markup://AIO:AccountFormByID}
Lightning Component Controller Thanks
<aura:application >
<aura:attribute name="AccountId" type="String"/>
Value in AccountId Attribute: {!v.AccountId}
<AIO:AccountFormByID accGetID="{!v.AccountId}"/>
</aura:application>