
On a Freedom UI page, you can execute requests to perform various actions, such as to display a message dialog, a toast message, open a page, reloading a list or page, etc. One of the available types of requests you can execute is to copy a value to the clipboard. This request is called a crt.CopyClipboardRequest. All you need to do is to execute this request and pass a value to copy.
Let’s take a look how it works:
request.$context.executeRequest({ type: "crt.CopyClipboardRequest", value: "Some text to copy" });
A great combination is to also follow this up with a toast message to let the user know the value has been copied, such as the following example (don’t forget to await the crt.CopyClipboardRequest to allow it to complete before you show the toast):
await request.$context.executeRequest({ type: "crt.CopyClipboardRequest", value: "Some text to copy" }); request.$context.executeRequest({ type: "crt.NotificationRequest", message: "The text has been copied to the clipboard" });
This way, the user see an out of the way message that the value has been copied. It especially makes a nice addition to a list’s row actions to copy values from the row:
Subscribe To Our Newsletter
Join our mailing list to receive the latest Infor CRM (Saleslogix) and Creatio (bpm'online) news and product updates!
You have Successfully Subscribed!