Assistant.sendRedirect(options)
Method Description |
Manages redirects in an assistant. This method also addresses the case in which one assistant redirects to another assistant. In this scenario, the second assistant must return to the first assistant if the user Cancels or Finishes. This method, when used in the second assistant, ensures that users are redirected back to the first assistant. |
Returns |
void |
Supported Script Types |
Suitelets For more information, see SuiteScript 2.x Script Types. |
Governance |
None |
Module |
|
Since |
2015.2 |
Parameters
The options parameter is a JavaScript object.
Parameter |
Type |
Required / Optional |
Description |
Since |
---|---|---|---|---|
|
response |
required |
The response that redirects the user. |
2015.2 |
Syntax
The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/ui/serverWidget Module Script Samples.
//Add additional code
...
var assistant = serverWidget.createAssistant({
title: 'Small Business Setup Assistant',
hideNavBar: true
});
if (request.method === 'POST') {
if (assistant.getLastAction() === 'finish') {
assistant.finishedHtml = 'Completed!';
assistant.sendRedirect({
response: response
});
}
}
...
//Add additional code