0

I am creating multiple row with sobject type abc and Reason__c as picklist value. with the below code :

<aura:component controller="Controller" Implements="lightning:availableForFlowScreens">     
    <aura:attribute name="accountList" type="abc[]" access="global"/> 
    <aura:attribute name="abcRec" type="abc[]" access="global"/>


      <lightning:input name="strtdate" type="date" required="true" maxlength="50" label="Date From" value="{!acc.Start_Date__c}" />
   </td>
   <td>
      <lightning:input name="enddate" type="date"  maxlength="10" label="Date  To" value="{!acc.End_Date__c}" />
   </td>
   <td>
      <lightning:input name="Reason"   label="Reason" value="{!acc.Reason__c}"/>
   </td>

I am pushing the values from helper using the below code

accountList.push({
            'sobjectType': 'abc',
            'Start_Date__c': '',
            'End_Date__c': '',
            'Reason__c': '',
            'Comments__c': ''
        });
        component.set("v.accountList", accountList);

I need to make reason as picklist value without making the code complex. Tried to use value="{!acc.Reason__c}" however its not working . Any workaround

  • what do you mean "its not working", is it empty,are you getting any error ? – User6670 Apr 24 at 7:07
  • picklist values are not coming , Want to render picklist values from the field – AvengerSF Apr 24 at 11:26
  • are you creating record of abc type and you are asking why you cant see picklist values that you can select in "Reason__c" or are you fetching the record and just displaying them and you dont see the picklist value assign to that record – User6670 Apr 24 at 11:31
  • while creating records I want the reason which is a picklist field at backend should render its values for input name reason. – AvengerSF Apr 24 at 11:33
  • if you are just creating record you can also use lightning data service which is much easier developer.salesforce.com/docs/component-library/bundle/… – User6670 Apr 24 at 11:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.