
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 08:08 AM
Hello,
I've created an UI Action for Agent Workspace which gives me some kind of result.
function onClick( g_form ) {
g_modal.showFields({
title: "Reference Field Test",
fields: [{
type: 'reference',
name: 'caller_id',
label: 'Label 0',
referringTable: 'incident',
referringRecordId: g_form.getUniqueValue(),
}],
size: 'lg'
});
}
I do however want to reference my own table that I've created but I can't seem to get it to work. Here's what I've tried:
function onClick( g_form ) {
g_modal.showFields({
title: "Reference Field Test",
fields: [{
type: 'reference',
name: 'u_name',
label: 'Label 1',
referringTable: 'sn_agent_workspace_external_users',
referringRecordId: g_form.getUniqueValue(),
}],
size: 'lg'
});
}
I was unable to find any documentation on this so that's why I'm asking a question here. Has anyone done something similar before that could point me in the right direction?
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
05-19-2021 08:19 AM
Hi
This is a sample for the incident, try this as per your requirement.
function onClick(g_form) {
var fields = [{
type: 'reference',
name: 'caller_id', //Give your custom reference field
label: getMessage('What is your name?'), //Give as per your requirement
mandatory: true,
reference: 'sys_user', //Give which table your custom field refers to
referringTable: 'incident', //Give your custom table
referringRecordId: g_form.getUniqueValue()
}
];
g_modal.showFields({
title: "Enter your details",
fields: fields,
size: 'lg'
}).then(function(fieldValues) {
g_form.setValue('caller_id', fieldValues.updatedFields[2].value);
g_form.save();
});
}
For more Info Workspace UI ACtions
Please mark my answer as helpful/correct, if applicable.
Best regards,
Sai Kumar
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-25-2022 03:24 AM
Hi
Incase you know how to display Date/Time field using g_modal.showFields, please let us know.