-
Notifications
You must be signed in to change notification settings - Fork 24
MobileCRM.UI.EntityForm.setFileFieldContent
rescocrm edited this page Oct 6, 2025
·
1 revision
[v18.2] Sets the file field content and file name on entity record shown on this EntityForm.
Setting file field content is possible only in offline mode. This method fails in online mode.
| Argument | Type | Description |
|---|---|---|
| fieldName | String | Logical name of the file field that has to be changed. |
| documentFileName | String | A file name that should be used when presenting the binary content. |
| documentContent | String | Base64-encoded binary file content. |
This example demonstrates how to change the file field which is currently edited on entity form.
MobileCRM.UI.EntityForm.setFileFieldContent("new_document", "Sample.txt", btoa("Sample text content..."))
.then(result => {
if (result) {
onCompleted();
}
else {
displayError("Unexpected error setting entity record file field.");
}
})
.catch(error => displayError(`Error setting entity record file field: ${error}`));