Event Handler - Create new Record

Spaceballs
Kilo Sage

Hi, 

I'm new to the UI builder, I have New button when clicked I want it to create a new record and bring me to the form.

when clicked

Spaceballs_0-1675803251217.png

is returning

Spaceballs_1-1675803267997.png

 

 

function handler({api, event, helpers, imports}) {
    api.emit('NAV_ITEM_SELECTED', {
        "route": "https://instance.service-now.com/now/appenginestudio/my-apps/ab8919792f98211077fa59a72799b6f6",
        "fields": {
            table: "x_964096_my_test_1_testtable1",
            sysId: "-1",
        },
        
    });
}

 What am I doing wrong?

2 REPLIES 2

GV Jan Moser
Giga Guru

Hi,

the route must be name of one of your pages where you have your reord to be displayed (probably "record" page in your example), not a full url.

Jan

GV Jan Moser
Giga Guru

Hi,

 

the route should be name of one of your pages/routes where the record form is implemented) generally, the "record" page is created for such purposes.

 

Change it this way and it will work.

 

Jan