ICommonFunctions
Provides set of common functions for interacting with the environment. This interfaces is binded to the global MFiles object.
Example
// Save a key into webstorage
await MFiles.WriteToWebStorage("key", "value")
Properties
| Name | Type | Description |
|---|---|---|
| AnonymousUser | boolean | |
| CurrentApplicationPlatform | string |
Methods
| Name | Description |
|---|---|
| DeleteFromWebStorage | Deletes the key value pair stored in the browser web storage for the given key. |
| DownloadFileAsDataUri | Downloads a file from an object as a base64-encoded data URI. Retrieves the content of a specific file version from a vault object and returns it as a data URI string with base64 encoding. This is useful for embedding file content directly in HTML or passing file data as strings. Files larger than 64MB are rejected to prevent memory exhaustion. |
| GetAccentColor | Gets accent color. |
| GetClientLanguage | Returns language code of current client language. |
| GetClientLocale | Returns language code of current client locale. |
| GetSessionInfo | Gets the current NonSensitiveSessionData information. |
| GetUTCOffset | Gets server based UTC offset in minutes |
| GetVaultInfo | Gets the current vault information. |
| GetWebLink | Get web link for an object. |
| OpenExternalWebLink | Open external web link in a tab. Note: This method only supports "http", "https" and "mailto" protocols. |
| ReadFromWebStorage | Retrieves the value stored in the browser web storage for the given key. |
| ReportException | Reports an exception. The exception can be displayed to the user or written to the event log. |
| ShowEditObjectWindow | Show object popup window to edit exist object. |
| ShowNewObjectWindow | Show new object creation window to create new object. New object can be created using prefil properties as well. Note: Multiple files are not supported in ObjectCreationInfo.source_files. |
| ShowToast | Show toast message. |
| UploadTemporaryFiles | Uploads temporary files to the server and returns a file source which other operations can use to access the uploaded files. The uploaded files are temporary and will be automatically removed from the server after a certain period of time. The caller should use the returned file source to perform further operations with the uploaded files before they expire. The method also handles duplicate detection and searchable PDF conversion if the features are enabled. A user must interact with the dialogs and may cancel the upload process during these steps, causing an error to be thrown. |
| WriteToWebStorage | Writes the value in the browser web storage. |