You need to sign in to do that
Don't have an account?
sheila srivatsav
fetch LDS attribute in controller.js
I have a lightning data service .
I have shown the complete code I have with me.
<aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed"/>
<aura:attribute name="recordError" type="String" description="An error message"/>
<aura:attribute name="record" type="Object" description=""/>
<force:recordData aura:id="somecaseRecord"
recordId="{!v.caseId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields="{!v.simpleRecord}"
mode="VIEW"
fields="Id,Status"/>
I have Status is a field defined in the case object and case Id is generated during the init handler.
I want to fetch the value of the status field in the controller.js
if (component.get("v.simpleRecord.Status") != "Closed")
{
//then do some logic
}
I tried doing like this also.
if (component.get("v.record").Status != "Closed")
{
//then some logic I will do
}
But its not fetching the status field value
Let me know where I am going wrong.
thanks
sheila S
I have shown the complete code I have with me.
<aura:attribute name="simpleRecord" type="Object" description="A simplified view record object to be displayed"/>
<aura:attribute name="recordError" type="String" description="An error message"/>
<aura:attribute name="record" type="Object" description=""/>
<force:recordData aura:id="somecaseRecord"
recordId="{!v.caseId}"
targetError="{!v.recordError}"
targetRecord="{!v.record}"
targetFields="{!v.simpleRecord}"
mode="VIEW"
fields="Id,Status"/>
I have Status is a field defined in the case object and case Id is generated during the init handler.
I want to fetch the value of the status field in the controller.js
if (component.get("v.simpleRecord.Status") != "Closed")
{
//then do some logic
}
I tried doing like this also.
if (component.get("v.record").Status != "Closed")
{
//then some logic I will do
}
But its not fetching the status field value
Let me know where I am going wrong.
thanks
sheila S
event.getParams() --> retuns Object and evenrs are fired by SF component