Ava
10/09/2024, 5:11 PMCeligo AI
10/09/2024, 5:11 PMAI generated answer (using internal Slack threads):Yes, you can display a message when a function is called and hide the message when the function is finished executing using a client-side SuiteScript. Here's a general approach based on the conversations: 1. Create a message using the
N/ui/message
module. This message can be displayed when the function is called.
javascript
var myMsg = message.create({
title: "Processing",
message: "Function is executing...",
type: message.Type.INFORMATION
});
myMsg.show();
2. Call your function. If it's an asynchronous operation, consider using Promises or async/await to handle the asynchronous nature of the operation.
3. Once the function has finished executing, hide the message.
javascript
myMsg.hide();
In the context of a Suitelet, you can use the Form.addPageInitMessage()
method to display a message when the page is initialized.
If you need to call a non-entry point client function from a Suitelet context, you can add a hidden field to be toggled from the Suitelet and use the pageInit
function. Alternatively, you can move the function to its own module, then include the module in the entry points.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
10/09/2024, 5:11 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.848190844
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.842383504
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.840986431
Celigo AI
10/09/2024, 5:11 PM