How do I navigate between SA built-in and custom pages?

Must have a portal build created on or after 5/7/21 for this feature

 

Sometimes you want to keep some of the SA built-in pages in tact while using your own custom pages as well. For example, you might want to have a custom account details page that navigates to the built-in pages for linking users, devices, and child tenants.

 

By default, the built-in pages will navigate to other built-in pages. So, if in the above example, you link a user to an account, instead of redirecting to your custom account details page after linking, you will be redirected to the built-in account details page. 

 

In order to avoid this, on any custom SA pages that interact with built-in pages, make sure to use the following code to navigate to the built-in page:

$state.go(<built-in page module>, {
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params':
{'page_name': <custom page name>,
'custom_param': <optional, any custom params needed to get back to the custom page, such as the tenant ID if we're going back to a custom account details page>,
'custom_data': <optional, any custom data needed to get back to the custom page>
}
});

 

Examples

Add tenant

 $state.go('app.add_form', {
'type': 'Tenants',
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name':'manage_accounts'}
});

 

Add user

 $state.go('app.add_form', {
'type': 'Users_add',
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name':'users'}
});

 

Link user to account

 $state.go('app.sa_link_user', {
'tenant_id': vm.tenant_id,
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name':'account', 'custom_param': vm.tenant_id}
});

 

Link device to account

 $state.go('app.sa_link_device', {
'tenant_id': vm.tenant_id,
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name':'account', 'custom_param': vm.tenant_id}
});

 

View device linked to account

 $state.go('app.sa_view_device', {
'device_id': device_id,
'tenant_id': vm.tenant_id,
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name':'account', 'custom_param': vm.tenant_id}
});

 

Link child account

 $state.go('app.sa_link_child_tenant', {
'tenant_id': vm.tenant_id,
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name':'account', 'custom_param': vm.tenant_id}
});

 

View user as Super Admin

 $state.go('app.sa_view_user', {
'user_name': user_name,
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name': 'manage_users'}
});

 

View user as Account Admin

 $state.go('app.ta_view_user', {
'user_name': user_name,
'callback_route': 'app.M1DashboardController.detail.withParam',
'callback_params': {'page_name': 'manage_users_ta'}
});