- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:23 AM
In the UI action of sn_hr_core_case table an incident sys_id is recevied ,i need to set the received value to transferred_to field( reference field). I am using g_form.setValue('transferred_to',value) and it is not working.Any help is appreciated.
Thanks and Regards,
Vasu
Solved! Go to Solution.
- Labels:
-
HR Service Delivery
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 04:07 AM
then unless it's present in workspace view g_form cannot set the value
add that in your view and then verify
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:28 AM
Hi,
transferred_to field refers to HR Case table then how it can store the incident sysId
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:30 AM
The transferred_to field refers to the Task table but it is present in the sn_hr_core_case table.
Thanks and Regards,
Vasu
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:44 AM
Hi,
then it should work
please share all the script
Regards
Ankur
Ankur
✨ Certified Technical Architect || ✨ 9x ServiceNow MVP || ✨ ServiceNow Community Leader
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-16-2022 03:46 AM
function onClick(g_form) {
var incident_number = '';
g_modal.showFields({
title: "Please provide all information for incident",
fields: [{
type: 'textarea',
name: 'u_incidentreason',
label: 'Incident description:',
mandatory: true
}, {
type: 'reference', // type of modal (ie text, reference, etc)
name: 'assignment_group', // reference field on the current record used to search
label: 'Assignment Group', // message to display above the search field
mandatory: true, // sets the field to mandatory
reference: 'sys_user_group', // table that the reference field in "name" refers to
referringTable: 'incident', // table of the current record
referringRecordId: g_form.getUniqueValue(), // sys_id of the current record
}],
size: 'md'
}).then(function(fieldValues) {
var ga = new GlideAjax("sn_hr_core.hrTransferToInc");
ga.addParam("sysparm_name", "transferCase");
ga.addParam("sysparm_assignment_group", fieldValues.updatedFields[1].value);
ga.getXMLAnswer(saveForm);
function saveForm(result) {
g_modal.alert(result); //result value returns incident sys_id in string format
incident_number = result;
g_form.setValue('transferred_to',result);//not working
g_form.save();
}
});
}