ebs.goToRoute
(FintechOS Studio 22.1 and later)
Maintains the current route and navigates to the specified page with or without saving it in the browser's history.
This function allows navigation when the FintechOS Portal is either in Single Page Application mode (see EbsRouter for details) or in legacy mode. On environments that operate in legacy mode, make sure you provide the
legacyUrl property in the optional routeConfig parameter.Syntax
function ebs.goToRoute(routeState: IRouterState, routeConfig?: IRouteConfig, replaceHistory?: boolean): void;
| Parameter | Type | Description |
|---|---|---|
routeState
|
IRouterState | Identification information for the page (the state). |
routeConfig?
|
IRouteConfig | Optional configurations for backward compatibility, pop-up windows, and fallback routes. |
replaceHistory?
|
boolean | Allows you to skip certain pages from the navigation history when you press the browser's Back and Forward buttons, such as secondary pages that you open in pop-up windows.
|
Type Aliases
Contains the identification information of a page. The routeData property can take different forms, depending on the type of page (a list, a flow step, a custom form, etc.).
{
routeData: IRouteListState | IRouteFormDrivenState | IRouteCustomActionState | IRouteBusinessTransactionsState | any;
}
| Property | Type | Description |
|---|---|---|
routeData
|
IRouteListState | IRouteFormDrivenState | IRouteCustomActionState | IRouteBusinessTransactionsState | any | JSON object containing information about the page. |
Identification information specific to a list page.
{
type?: string;
mainHtmlId?: string;
entityName: string;
viewName?: string;
menuItemContext?: string;
}
| Property | Type | Description |
|---|---|---|
type(optional)
|
string | "list" - Indicates that this is a view page. |
mainHtmlId(optional)
|
string | ID of the container HTML element in which the list is shown. This parameter is used only internally in the platform code. |
| entityName | string | Name of the view's source entity. |
viewName(optional)
|
string | Name of the view. |
MenuItemContext(optional)
|
string | Menu item ID. This parameter is used only internally in the platform code. |
Identification information specific to a form or form driven flow page.
{
formId?: string;
type?: string;
mainHtmlId?: string;
entityName: string;
defaults?: string;
returnHash?: string | any;
formName?: string;
isUserJourney?: boolean;
pageNo?: number|string;
menuItemContext?: string;
}
| Property | Type | Description |
|---|---|---|
formId(optional)
|
string | ID of the record (if the form or form driven flow is in edit mode). |
type(optional)
|
string |
|
mainHtmlId(optional)
|
string | ID of the container HTML element in which the form is shown. By default, this is ebsContainer. |
entityName
|
string | Name of the form driven flow's source entity. |
defaults: 'digitalJourneyId*123-456-78,key*value' |
string | Default values for various form fields. Use the following format: attribute1Name:value,attribute2Name:value... |
returnHash(optional)
|
string | any | A return URL for when the user completes a certain flow. |
formName(optional)
|
string | Name of the form or form driven flow. |
isUserJourney(optional)
|
boolean | Indicates is the form driven flow is added as a user journey for an entity. |
pageNo(optional)
|
number | string | Name or number of the form or form driven flow's step. NOTE Numbering starts from 0, so the first step is number 0, the second step is number 1, etc. |
menuItemContext(optional)
|
string | Menu item ID. This parameter is used only internally in the platform code. |
Identification information specific to a custom form (also known as a custom flow). You can use either the form's unique identifier or name.
{
customActionId?: string;
customActionName?: string;
}
| Property | Type | Description |
|---|---|---|
customActionId(optional)
|
string | Custom action unique identifier. |
customActionName(optional)
|
string | Custom action name. |
Identification information specific to a record's business workflow transitions list.
{
type: "BW";
formId: string;
entityName: string;
mainHtmlId?: string;
}
| Property | Type | Description |
|---|---|---|
type
|
"BW" | Indicates that the page is a business workflow transitions list. |
formId
|
string | ID of the record. |
entityName
|
string | Name of the entity. |
mainHtmlId(optional)
|
string | ID of the container HTML element in which the list is shown. By default, this is ebsContainer. |
Optional configurations for backward compatibility, pop-up windows, and fallback routes.
{
legacyUrl?: string;
popup?: boolean;
fallbackRoute?: EbsRouteName;
defaultRoute?: EbsRouteName;
}
| Property | Type | Description |
|---|---|---|
legacyUrl(optional)
|
string | Legacy URL of the page. Provides backward compatibility, allowing the function to also execute on legacy (multi-page) environments. |
popup(optional)
|
boolean |
|
fallbackRoute(optional)
|
EbsRouteName | Relevant only for EbsRouter.continueRoute. |
defaultRoute(optional)
|
EbsRouteName | Deprecated. Use fallbackRoute instead. |
Examples
In this example, we navigate o a specific entity view in single page application mode, while maintaining the current route and saving the navigation step in the browser's history:
- The name of the entity is myEntity.
- The name of the view is default.
- We store the identification information of the view in the routeData constant.
- We store the identification information of the page (state) in the routeState constant.
const routeData:IRouteListState = { entityName: myEntity, type: list, viewName: default };
const routeState:IRouterState = { routeData };
ebs.goToRoute(routeState)
In this example, we navigate o a specific entity view in legacy mode while maintaining the current route and not saving the navigation step in the browser's history:
- The name of the entity is myEntity.
- The name of the view is default.
- We use the ebs.getListNavigationUrl function to retrieve the navigation URL of the entity view and store it in the legacyUrl constant.
const legacyUrl = ebs.getListNavigationUrl(myEntity, default);
ebs.goToRoute(routeState, {legacyUrl}, true);