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.

UI Builder - New button opens existing record

thomaskennedy
Kilo Sage

My Device page has one required param (table) and one optional (sysId). My List's Row Clicked handler opens a url, passing table and sysId, like so:

return {
    route: null,
    fields: null,
    params: null,
    redirect: null,
    passiveNavigation: null,
    title: "anything",
    multiInstField: null,
    targetRoute: null,
    external: {
        url: "/x/acso/rf/device/" + event.payload.table + "/params/sysId/" + event.payload.sys_id
    }
};

That works fine. But my New Button Clicked handler, which returns the same url without the sysId, opens an existing record -- and always the same record.

return {
    route: null,
    fields: null,
    params: null,
    redirect: null,
    passiveNavigation: null,
    title: "",
    multiInstField: null,
    targetRoute: null,
    external: {
        url: "/x/acso/rf/device/" + event.payload.table
    }
};

find_real_file.png

So I looked at the look_up_record data source on the Device page. The param test values are set up like this:

find_real_file.png

With the params set up this way (that is, with sysId left empty), the preview shows the RFD7110517 record I mentioned above.

find_real_file.png

That looks wrong to me. The data resource should return an empty arrray until a real sysId (or -1) is supplied.

If I change the test params and put in a -1 for sysId, now the data resource preview shows an empty array.

find_real_file.png

find_real_file.png

I could go back to my New Button Clicked handler and explicitly pass a -1, like /params/sysId/-1. But if I have to pass a -1 for sysId, then that param isn't really optional. This looks like a defect. Have I overlooked something?

 

 

1 ACCEPTED SOLUTION

DrewW
Mega Sage

To get a new record I have always had to pass -1 for the sys_id.  The system has always worked that way.  I would say if its an issue its just an issue with the documentation.

View solution in original post

1 REPLY 1

DrewW
Mega Sage

To get a new record I have always had to pass -1 for the sys_id.  The system has always worked that way.  I would say if its an issue its just an issue with the documentation.