How to open a form through UI action and pre=populate fields on form
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 07:13 PM - edited 07-29-2023 08:33 PM
So my UI action opens a modal window that has a dropdown field. whatever user choses and clicks on create button in the modal button must take him to A CREATE NEW incident form and prepopulate a field on the incident form with that selected value from popup.
any tips, ideas on this
EDIT -
Here is my ask -
From the workspace view, click on UI action button to open a dialog window.
The dialog popup shows few fields (assume type and short text) and has a create button.
when I select the type and fill in the short text and click on create in the dialog window. the popup must close and a workspace view new incident form must open and the type and short text must be auto populated on the landing form.
Note - this is for workspace view and not for native UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-28-2023 09:47 PM
can you share your code for the modal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 08:31 PM
I do not have any code at present. trying to understand the approach from workspace UI action to proceed.
Here is my ask -
From the workspace view, click on UI action button to open a dialog window.
The dialog popup shows few fields (assume type and short text) and has a create button.
when I select the type and fill in the short text and click on create in the dialog window. the popup must close and a workspace view new incident form must open and the type and short text must be auto populated on the landing form.
Note - this is for workspace view and not for native UI
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 06:21 AM
function onClick(g_form) {
var fields = [{
type: 'textarea',
name: 'work_notes',
label: getMessage('Reason'),
mandatory: true
},
{
type: 'choice',
name: 'reason_code',
label: getMessage('Reason code'),
value: getMessage(' -- Select -- '),
choices: [{
displayValue: 'Duplicate',
value: 'duplicate'
},
{
displayValue: 'Canceled',
value: 'canceled'
}
],
mandatory: true
},
{
type: 'reference',
name: 'caller_id',
label: getMessage('What is your name?'),
mandatory: true,
reference: 'sys_user',
referringTable: 'incident',
referringRecordId: g_form.getUniqueValue(),
value: g_form.getValue('caller_id'),
displayValue: g_form.getDisplayValue('caller_id')
}
];
g_modal.showFields({
title: "Are you sure?",
fields: fields,
size: 'lg'
}).then(function(fieldValues) {
// need to use the values inputted by user and open incident form in workspace and poplate fields on form with those values
});
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-29-2023 03:35 PM
What are your field names, which field is getting populated on the incident form? You didn’t really provide YOUR code your using,
the link you got that from gives you plenty of options, even shows you how to open a URL