11. Router
context.router.id
sync· returnsstring
Returns the primary record ID from the current page URL. This is the ID segment in a detail page route such as .../offers/12 — in that case context.router.id returns "12".
var offerID = context.router.id;
var offer = await context.getEntity("offers", offerID);
context.router.subId
sync· returnsstring
Returns the secondary ID from the URL, used on nested detail pages (e.g. .../offers/12/items/5 — returns "5").
var itemID = context.router.subId;
context.router.id and context.router.subId correspond to the URL segments of the currently active Details Page. If you are not on a details page, these will be undefined. Always check before using them in list or dashboard contexts.