UI Builder: "Link To Destination" and "NAV_ITEM_SELECTED" Events Not Working for New Records.

DEV 1
Tera Contributor

Description:
I am working on a UI Builder page where I need to redirect users from a subpage (e.g., "kb_view") back to the record page (e.g., "incident") when a specific action occurs. This works for existing records but not for new records where the sys_id is in the format "-1_u_1".

What I Tried:

  1. Using "Link To Destination":
    Attempted to configure navigation via "Link To Destination," but it does not work for new records.
  2. Using the NAV_ITEM_SELECTED Event:
    Below is the script I used:

    const redirectPayload = {
  3.     redirect: true,
  4.     route: "record",
  5.     fields: {
  6.         table: "incident",
  7.         sysId: api.state.parentTabRecordId, // sys_id of the new record
  8.     },
  9. };
  10. // Emit navigation event to redirect the user to the incident record
  11. api.emit("NAV_ITEM_SELECTED", redirectPayload);
    Unfortunately, this also does not work for new records.

Goal:

I need a reliable way to redirect users from the "kb_view" subpage back to the "record" page, regardless of whether the sys_id belongs to an existing record or a new record (e.g., "-1_u_1").

Questions:

  1. Is there a specific configuration or workaround to handle navigation for new records in UI Builder?
  2. Does NAV_ITEM_SELECTED support this use case, and if not, what alternative approach should I use?
  3. How can I ensure compatibility for both existing and new records when using navigation events in UX client scripts?

 @Brad Tilton 

Any insights or suggestions would be greatly appreciated.

5 REPLIES 5

@Brad Tilton 

Can we set up client-side communication between the record page and the KB sub-page, such that we can manipulate the field values on the record page from a button event on the KB page?

Here is the reference URL:
now/sow/record/incident/33ed5194fc8256d85dcff689977724a0/sub/kb_view/kb_knowledge/f1f728b28581da5450c042e7ef7bae14

We aim to update the fields on the record page from the knowledge page. Is there any way to achieve this functionality?