- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-18-2022 04:39 AM
Hi,
Have anyone tried creating a button from a landing page with the purpose of creating a new record?
Basically what i want to achieve is close to the "New" button on lists, but it needs to be a more simpe version with no steps as the default version has. I need a button on one of my HR landing pages which, once clicked does the following:
1. Starts creating a new case with a few predefined fields e.g. assignment group.
2. Navigates the user to the newly created record to fill in the remaining details.
3. Allows the user to save the case once details are filled in.
Optimally it would just initialize the case creation once the button is pressed and allow the user to fill in the details, only saving the record once the user presses save.
Is such a thing possible? You can see the button on the dashboard here:
Hope someone can help.
Solved! Go to Solution.
- Labels:
-
UI Builder : Next Experience
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 06:12 AM
First, create a page script, and assign it to the click event of the button.
The script content should be something like:
function handler({api, event, helpers, imports}) {
api.emit('NAV_ITEM_SELECTED', {
"route": "record",
"fields": {
table: "sn_hr_core_case",
sysId: "-1",
},
"params": {
"query": "short_description=prefill^assignment_group=6816f79cc0a8016401c5a33be04be441"
}
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2022 06:12 AM
First, create a page script, and assign it to the click event of the button.
The script content should be something like:
function handler({api, event, helpers, imports}) {
api.emit('NAV_ITEM_SELECTED', {
"route": "record",
"fields": {
table: "sn_hr_core_case",
sysId: "-1",
},
"params": {
"query": "short_description=prefill^assignment_group=6816f79cc0a8016401c5a33be04be441"
}
});
}

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 02:11 PM
I think you could also do this without a script using the link to destination event handler.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2022 07:34 PM
Good point, that would be the better solution!
Although it may be likely that a script is needed to determine the dynamic values, like assignment group...
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-23-2022 12:23 AM
I did try using the destination eventhandler "New case" however the OOB new case page did not work for my purpose. But i guess you could build a new page for the event handler. But, in my case the simplest solution seemed to be the script posted here, so i didnt test that method.