Skip to content

Commit 3dcd3b5

Browse files
committed
Update readme
1 parent e16f04c commit 3dcd3b5

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

README.md

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,17 +81,20 @@ toast(acct[0].NumberOfEmployees, "success");
8181
$A.get("e.force:refreshView").fire();
8282
```
8383

84-
- Upload files to ContentVersion(ContentDocument) records
84+
- Add a 'File' to the current record
8585

8686
```js
8787
let fileContent = btoa("Hello World");
8888
/* convert your file content to base64 data before uploading */
8989
let cv = {
9090
VersionData: fileContent,
9191
Title: "My Awesome File",
92-
PathOnClient: "MyFile.txt"
92+
PathOnClient: "MyFile.txt",
93+
FirstPublishLocationId: recordId
9394
};
9495
let cvId = await dml.insert(cv, "ContentVersion");
96+
toast("New file Added", "success");
97+
$A.get("e.force:refreshView").fire();
9598
```
9699

97100
### About the Syntax

0 commit comments

Comments
 (0)