If the short description contain infra keyword in the beginning then category should add a new choice “INFRA” and set it to the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-17-2021 11:49 PM
- If the short description contain infra keyword in the beginning then category should add a new choice “INFRA” and set it to the same.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
06-18-2021 12:25 AM
You can Write following onchange client script
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
var sd = g_form.getValue('short_description');
if (sd == 'INFRA') {
var pos = sd.search('INFRA');
if (pos == 0) {
g_form.addOption('category', 'infra', 'Infra');
g_form.setValue('category', 'infra');
}
} else {
g_form.removeOption('category', 'infra', 'Infra');
}
//Type appropriate comment here, and begin script below
}
Please mark as correct or helpful,
regards,
Nikita Tajane
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-16-2022 11:33 PM
Use the following onchange client script on short description field
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
g_form.removeOption('category','infra','INFRA');
g_form.setValue('category','');
return;
}
var SD = g_form.getValue('short_description');
var newSD = SD.includes('infra');
if(newSD == true){
g_form.addOption('category','infra','INFRA');
g_form.setValue('category','infra');
}
}