Created
July 3, 2019 03:12
-
-
Save surajp/b7339d3e9c56b41279b45845b4e63dd4 to your computer and use it in GitHub Desktop.
Create Content Version using uiRecordApi in LWC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import {createRecord} from 'lightning/uiRecordApi'; | |
const fileData={ | |
Title:'Test File', | |
PathOnClient:'myfile.txt', | |
VersionData: window.btoa('Hello,World'), | |
Description:'test file' | |
} | |
const payload={apiName:'ContentVersion',fields:fileData}; | |
createRecord(payload); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment