+ Start a Discussion
Narendra Kumar 127Narendra Kumar 127 

We can't find the correct component or value for the Quantity field.

Below is my code. 

<aura:component >
    <aura:attribute name ="item" type= "Camping_Item__c" required="true"/>
    <p> Name : {!v.Camping_Item__c.Name__C} </p> 
    <P> PRICE :
        <lightning:formattedNumber Value="{!v.Camping_Item__c.Price__C}" style= "currency"/> </P> 
   <p> Quantity :
       <lightning:formattedNumber Value="{!v.Camping_Item__c.Quantity__C}" style= "integer " />   </p>
    <p>Packed : {!v.Camping_Item__c.Packed__C} </p>
    
    <lightning:input type = "toggle"
                     lable="Packed "
                     name="Packed"
                     checked="{!v.camping_item__c.Packed__C}"/>                                          
</aura:component>

I am recieving "We can't find the correct component or value for the Quantity field."  Any help is really appriciated. 
Best Answer chosen by Narendra Kumar 127
mukesh guptamukesh gupta
Hi Narendra,

Please use below code:
 
<aura:component >    
    <aura:attribute name="item" type="Camping_Item__c" required="true"/>
    <p>Name:
    <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price : <lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>  </p>
    <p>Quantity : <lightning:formattedNumber value="{!v.item.Quantity__c}"/></p>
    <p>Packed?:<lightning:input type="toggle" label="Packed" name="togglevalue" checked="{!v.item.Packed__c}" />
    </p>
</aura:component>

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks

Mukesh

All Answers

mukesh guptamukesh gupta
Hi Narendra,

Please use below code:
 
<aura:component >    
    <aura:attribute name="item" type="Camping_Item__c" required="true"/>
    <p>Name:
    <ui:outputText value="{!v.item.Name}"/>
    </p>
    <p>Price : <lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>  </p>
    <p>Quantity : <lightning:formattedNumber value="{!v.item.Quantity__c}"/></p>
    <p>Packed?:<lightning:input type="toggle" label="Packed" name="togglevalue" checked="{!v.item.Packed__c}" />
    </p>
</aura:component>

if you need any assistanse, Please let me know!!


Kindly mark my solution as the best answer if it helps you.

Thanks

Mukesh
This was selected as the best answer
Maharajan CMaharajan C
Hi Narendra,

Remove the style= "integer "  in  Quantity Output.
<lightning:formattedNumber Value="{!v.Camping_Item__c.Quantity__C}" style= "integer " />   --> Remove style here


Try the below one:
 
<aura:component >
    
    <aura:attribute name="item" type="Camping_Item__c" required="true"
                     default="{Name:'Tent', Price__c:100, Quantity__c:1, Packed__c:true}"/>
    
    <ui:outputText value="{!v.item.Name}"/>
    
   
    <lightning:formattedNumber value="{!v.item.Price__c}" style="currency" currencyCode="USD" currencyDisplayAs="symbol"/>

    <lightning:formattedNumber  value="{!v.item.Quantity__c}"/>

    <p> <lightning:input type="toggle"                            
                         label="Packed?"                           
                         name="packed"                         
                         checked="{!v.item.Packed__c}" />
    </p> 
</aura:component>

https://github.com/Mulodo-Salesforce-Training/trailhead-salesforce-challenge/blob/master/LightningComponentAttribuites.md
https://developer.salesforce.com/forums/?id=9060G0000005RbZQAU

Thanks,
Maharajan.C

 
Suraj Tripathi 47Suraj Tripathi 47

Hi Narendra,
Aura lightning is Case sensitive 
So i think you should use correct API name of each Object and Field Name i.e the name which are present in org
Just Like that
why you are using Capital C below =>     
        <lightning:formattedNumber Value="{!v.Camping_Item__c.Quantity__C}" style= "integer " /> 

correct

<lightning:formattedNumber Value="{!v.Camping_Item__c.Quantity__c}" style= "double" />
//in your org quantity datatype is double

if Quantity__c is same as Which are present in the ORG.
similary for all
I hope it would help you, Please mark it as the Best Answer if it helps you
Thank You
Kevin John 13Kevin John 13
Such Freaking Informative Post . (https://pcsoftnew.com/idm-crack-free-download/)