Boban Dragojlovic
10/04/2024, 3:50 PMCeligo AI
10/04/2024, 3:50 PMAI generated answer (using internal Slack threads):To determine whether a client script is being accessed via the customer portal, you can use the
runtime.executionContext
API in SuiteScript 2.0. This API returns the context in which the script is being executed.
Here is a sample code snippet:
javascript
var context = runtime.executionContext;
if(context === runtime.ContextType.USER_INTERFACE){
// The script is being accessed via the UI
} else if(context === runtime.ContextType.CUSTOMER_CENTER){
// The script is being accessed via the customer portal
}
In this code, runtime.executionContext
returns the context in which the script is being executed. If the script is being accessed via the customer portal, runtime.executionContext
will return runtime.ContextType.CUSTOMER_CENTER
.
******
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/04/2024, 3:50 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.816253066
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.811055183
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.806494236
Celigo AI
10/04/2024, 3:50 PM