Skip to main content

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

NameTypeDescription
AnonymousUserboolean
CurrentApplicationPlatformstring

Methods

NameDescription
DeleteFromWebStorageDeletes the key value pair stored in the browser web storage for the given key.
DownloadFileAsDataUriDownloads 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.
GetAccentColorGets accent color.
GetClientLanguageReturns language code of current client language.
GetClientLocaleReturns language code of current client locale.
GetSessionInfoGets the current NonSensitiveSessionData information.
GetUTCOffsetGets server based UTC offset in minutes
GetVaultInfoGets the current vault information.
GetWebLinkGet web link for an object.
OpenExternalWebLinkOpen external web link in a tab.
Note: This method only supports "http", "https" and "mailto" protocols.
ReadFromWebStorageRetrieves the value stored in the browser web storage for the given key.
ReportExceptionReports an exception. The exception can be displayed to the user or written to the event log.
ShowEditObjectWindowShow object popup window to edit exist object.
ShowNewObjectWindowShow 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.
ShowToastShow toast message.
UploadTemporaryFilesUploads 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.
WriteToWebStorageWrites the value in the browser web storage.