You need to sign in to do that
Don't have an account?

Error in $A.getCallback() [Cannot read property 'Name' of null]
AccountFormAndList.cmp:
<aura:component controller="CampingListController">
<aura:attribute name="cont" type="Account" />
<lightning:layout >
<lightning:layoutItem size="3">
<form>
<lightning:input name="conName" label="Name" aura:id="conForm"
value="{!v.cont.Name}" required="true"
messageWhenValueMissing="Name is required"
placeholder="ACC Name"/>
<lightning:button label="Create" onclick="{!c.clickCreate}" />
</form>
</lightning:layoutItem>
</lightning:layout>
</aura:component>
Controller:
({
clickCreate : function(component, event, helper) {
var getCon=component.get("v.cont");
var action=Component.get("c.saveContact");
action.setParams({
"con": getCon
});
action.setCallback(this,function(response){
// component.set("v.contacts",response.getReturnValue());
var state=response.getState();
if(state==="SUCCESS"){
var name=a.getReturnValue();
alert("Hello from here"+name);
}
});
$A.enqueueAction(action);
}
})
Apex Class:
@AuraEnabled
public static Account saveContact(Account con){
upsert con;
return con;
}
I am getting below error when we type any letters in the input text box;

Help me in this.
Thanks
Srinivas
<aura:component controller="CampingListController">
<aura:attribute name="cont" type="Account" />
<lightning:layout >
<lightning:layoutItem size="3">
<form>
<lightning:input name="conName" label="Name" aura:id="conForm"
value="{!v.cont.Name}" required="true"
messageWhenValueMissing="Name is required"
placeholder="ACC Name"/>
<lightning:button label="Create" onclick="{!c.clickCreate}" />
</form>
</lightning:layoutItem>
</lightning:layout>
</aura:component>
Controller:
({
clickCreate : function(component, event, helper) {
var getCon=component.get("v.cont");
var action=Component.get("c.saveContact");
action.setParams({
"con": getCon
});
action.setCallback(this,function(response){
// component.set("v.contacts",response.getReturnValue());
var state=response.getState();
if(state==="SUCCESS"){
var name=a.getReturnValue();
alert("Hello from here"+name);
}
});
$A.enqueueAction(action);
}
})
Apex Class:
@AuraEnabled
public static Account saveContact(Account con){
upsert con;
return con;
}
I am getting below error when we type any letters in the input text box;
Help me in this.
Thanks
Srinivas
It's resolved with default values.
Thanks
Srinivas
I am facing the same the issue :
Uncaught Error in $A.getCallback() [Cannot read properties of null (reading 'isSuccess')]
Callback failed: apex://Profile2PermSet.permissionSetGroupsList/ACTION$getPermissionSetGroupsList
Can you please let me know what needs to be done as i am new to coding.Thank you