- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2024 05:39 AM
Hi,
This script will prompt the user with a string field. Is there any way to do the same just with a List type field reference to sys_user_group table?
function onClick(g_form) {
g_modal.showFields({
title: "Enter your reason",
fields: [{
type: 'textarea',
name: 'work_notes',
label: getMessage('Reason'),
mandatory: true
}],
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('work_notes', fieldValues.updatedFields[0].value);
g_form.save();
});
}
Result of above script:
 
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2024 10:19 AM
Hi @Alon Grod ,
It's done.
function onClick(g_form) {
var fields = [
{
type: 'glide_list',
name: 'watch_list',
label: getMessage('Add groups'),
mandatory: true,
reference: 'sys_user_group',
referringTable: 'incident',
referringRecordId: g_form.getUniqueValue(),
value: g_form.getValue('watch_list'),
displayValue: g_form.getDisplayValue('watch_list')
}
];
g_modal.showFields({
title: "Groups",
fields: fields,
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('watch_list', fieldValues.updatedFields[0].displayValue);
g_form.save();
});
}
Replace watch_list with the field that is used to map.
Replace incident with the table on which the filed is created.
Or, if you want to first try the above code, convert Watch list on the incident form from Reference to List type.
Steps: Configure dictionary on the Watch list, Change type from Reference to List and save the form.
If this information helps you, mark this post as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-18-2024 10:19 AM
Hi @Alon Grod ,
It's done.
function onClick(g_form) {
var fields = [
{
type: 'glide_list',
name: 'watch_list',
label: getMessage('Add groups'),
mandatory: true,
reference: 'sys_user_group',
referringTable: 'incident',
referringRecordId: g_form.getUniqueValue(),
value: g_form.getValue('watch_list'),
displayValue: g_form.getDisplayValue('watch_list')
}
];
g_modal.showFields({
title: "Groups",
fields: fields,
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('watch_list', fieldValues.updatedFields[0].displayValue);
g_form.save();
});
}
Replace watch_list with the field that is used to map.
Replace incident with the table on which the filed is created.
Or, if you want to first try the above code, convert Watch list on the incident form from Reference to List type.
Steps: Configure dictionary on the Watch list, Change type from Reference to List and save the form.
If this information helps you, mark this post as Helpful and Accept the solution.
Regards,
Najmuddin.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎08-20-2024 02:36 AM
Hello @Alon Grod ,
Did the above information helped you.
If yes, please mark the above post as Helpful and Accept the solution.
Regards,
Najmuddin.