I'm trying to create a lightning component for KYC Verification. And for that, we are trying to access a picklist field- 'Verification Id'. The data is not getting saved. Also, the files are not getting saved. I'm quite new in lightning components, can someone please help?
The component looks like this- test.cmp
<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,force:lightningQuickAction,force:hasRecordId" access="global">
<aura:attribute name="Customer__c" type="Customer__c"
default="{ 'sobjectType': 'Customer__c' }"/>
Choose Verification ID: <force:inputField value="{!v.Customer__c.Verification_ID__c}"/><!-- My picklist Field--><br/><br/>
<aura:attribute name="filetype" type="List" default="['.png', '.jpg', '.jpeg', '.pdf']" />
<lightning:fileUpload label="Verification Id"
name="fileUploader"
multiple="true"
accept="{!v.filetype}"
recordId="{!v.recordId}" onuploadfinished="{!c.handleUploadFinished}" /><br/>
<lightning:button variant="brand" type="button" name="Save" label="Save" onclick="{! c.handleClick }" />
</aura:component>
testController.js
({
handleUploadFinished: function (cmp, event) {
// Get the list of uploaded files
var uploadedFiles = event.getParam("files");
alert("Files uploaded : " + uploadedFiles.length);
// Get the file name
uploadedFiles.forEach(file => console.log(file.name));
},
handleClick : function (cmp, event, helper) {
alert("You clicked: " + event.getSource().get("v.label"));
},
})
The picklist value from the form needs to save in the field verification Id here.