Copy option from list field to reference field
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 02:26 AM
Hi ,
I need to copy the option from the list field to the reference field and from the reference choose one
2 REPLIES 2
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 02:45 AM
Use an onLoad client script (and if needed an onChange one as well (you are providing very limited information as to your requirements, so a lot of guessing here)):
onLoad
(function executeRule() {
var symptoms = g_form.getValue('symptoms');
if (symptoms) {
var filter = 'sys_idIN' + symptoms.split(',').map(function(item) {
return "'" + item.trim() + "'";
}).join(',');
g_form.setFilter('symptom', filter);
}
})();
onChange
(function executeRule(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '') {
return;
}
function setSymptomFilter(symptoms) {
var filter = 'sys_idIN' + symptoms.split(',').map(function(item) {
return "'" + item.trim() + "'";
}).join(',');
g_form.setFilter('symptom', filter);
}
setSymptomFilter(newValue);
})(g_form.getControl('symptoms'), g_form.getValue('symptoms'), g_form.getValue('symptoms'), g_form.isLoading(), false);
Please mark any helpful or correct solutions as such. That helps others find their solutions.
Mark
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-08-2024 03:34 AM
The symptoms is dot walking from the service offering table