EbsRouter.getState
(FintechOS Studio 20.1.3 and later)
Retrieves the identification information of the currently displayed page.
This function works when the FintechOS Portal is in Single Page Application mode (see EbsRouter for details).
Syntax
EbsRouter.getState(): IRouterState
Return Value
Returns an IRouterState JSON object containing a routeData property with details about the page, for instance:
{routeData: {
entityName: "dataConfigDeploymentPackage"
formName: "default"
menuItemContext: "b32a8a61-86ef-4fd7-b5b2-a7a173824b8c"
type: "insert"
}}
This object can be used as input for the state parameter in functions such as EbsRouter.callRoute, , or EbsRouter.continueRoute.
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 (optional) |
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. |
Examples
In this example, we retrieve the currently displayed page's identification information in a variable called currentState.
var currentState = EbsRouter.getState()