Find your people. Pick a challenge. Ship something real. The CreatorCon Hackathon is coming to the Community Pavilion for one epic night. Every skill level, every role welcome. Join us on May 5th and learn more here.

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

janmoser
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

janmoser
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