3

I'm using my LWC to upload photos as Files for a specific Custom Object within a community.

<lightning-file-upload label="Upload your photo" record-id={obj.Id} onuploadfinished={handleUploadFinished} file-field-name="IsMainPhoto__c" file-field-value="true"></lightning-file-upload>

When the user uploads the photo and the handleUploadFinished finishes, the photo is stored as a File of the obj, but the field "IsMainPhoto__c" is not set to true.

If it's useful, that community profile has privileges for R and W, and View All for the Custom Object.

Can anyone tell me why it's not working?

Thanks in advance!

4

The API name of the custom field must end with fileupload__c.

Please refer to documentation

https://developer.salesforce.com/docs/component-library/bundle/lightning-file-upload/documentation

1
  • I don't know how I overlooked this point!! Thanks a lot! Oct 28 '20 at 8:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.