Auto populate the Assigned vendor field based on assignment group on work order task( wm_task)
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-20-2024 08:20 AM - edited 11-20-2024 08:22 AM
I want to auto-populate the assigned vendor (assigned_vendor) when the assignment group changes on work order task ( wm_task) but onchange script is not working.
script:
field: assignment group
function onChange(control, oldValue, newValue, isLoading) {
if (isLoading || newValue == '')
return;
var assignedvendor = g_form.getValue("assigned_vendor");
if (assignedvendor == "") {
var assignmentgrp = g_form.getReference("assignment_group");
if (assignmentgrp != null)
g_form.setValue('assigned_vendor', assignmentgrp.vendors.toString());
g_form.setMandatory('assigned_vendor',true);
}
}
Assigned vendor:
reference qualifier: javascript:'sys_idIN' + current.assignment_group.vendors
reference qualifier: javascript:'sys_idIN' + current.assignment_group.vendors
issue: it's not immediately clearing the value of assigned vendor on work order task(wm_task).
any help on this really appreciated!
1 REPLY 1

Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-21-2024 06:12 AM - edited 11-21-2024 06:13 AM
Are you saying it is working, but not when the form loads? If so remove the isLoading from the if block
if (isLoading || newValue == '')
return;
If this information helped resolve your issue, please remember to mark response correct and thumbs up to help future community members on this information, thanks!