+ Start a Discussion
Himanshu Joshi 34Himanshu Joshi 34 

Data binding of lightning:input and aura:attribute with type sObject(field) is not working

There is a weird scenario I'm facing while I try to bind the markup UI tags with lighting aura:attribute as type sObject (fields). I'm trying to bind data to sobject's fields for different lightning:input tags, For one sObject attribute the binding works perfect, but in the same way for another sObject the data is not getting bound. For Ex:
<aura:attribute name="student" type="JN_Student__c" access="global" default="{'sobjectType' : 'JN_Student__c'}" /> <lightning:input aura:id="requiredVal" name="lastName" label="Legal Last Name"value="{!v.student.JN_Last_Name__c}" maxlength="20" required="true"/>
above works perfectly and the data persists as I show/hide this section. WHEREAS for,

<aura:attribute name="insuranceInstance" type="JN_Insurance__c" access="global" default="{'sobjectType' : 'JN_Insurance__c'}" /> <lightning:input aura:id="requiredVal" name="lastName" label="Legal Last Name" value="{!v.insuranceInstance.Name}" maxlength="20" required="true"/>

the 'v.insuranceInstance.Name' doesn't persists its value.
Please reply if anyone knows/encounted the same.
Raj VakatiRaj Vakati
Do you have access to the Object and Fields? Your code is correct i dnt see any issue in code 
Himanshu Joshi 34Himanshu Joshi 34
Hey @Raj, thanks for replying, I found out the root cause of the issue, it was becuase of the design attribute that I had linked with input flow variable (not sure why it would throw err as well though), but once I removed it from input parameter of flow, it worked alright!