Switches the default context of a function call. Use this function if there is a need to cross the boundaries of context, for example,
•If you are using .then() to take a next step if a promise is fulfilled, but in that next step, you want to refer back to the context of the previous step (.then() gives up that context by default). See Example.
•a VariableSet data source on one page must be accessed by controls on a different page.
Returns the result of executing the function func. This could be a result value, or a Promise that yields a result value.
The required context refers to the root context if it has the value "" (empty string). A subpage within the root context is referred to by the name of the page. In context, names of pages contained in pages are separated from the name of the containing page by a forward slash:
The required func is the function call for which the default context is being switched.
In this example, .executeInContext() is necessary because, otherwise, the context of the query (including its search condition values) is given up if and when you enter the .then() branch: