- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 03:41 AM
Hi
I have requirement where i need to populate values based on condition.
In catalog form i have chcek box field when it is select then single line field need to be displayed and readonly i have done using ui policies But "team possible" is the value that needs to be populate in that single line text
How can it be achieved pls provide the onchange script with it
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 03:52 AM
Write an onChange() client script on the checkbox with the below code
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if(isLoading) {
return;
}
if(newValue == 'true') { //If checkbox is checked
g_form.setValue('<pass single line text variable name>', 'team possible');
} else {
g_form.clearValue('<pass single line text variable name>'); //If checkbox is empty clear the single-line text variable
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 03:52 AM
Write an onChange() client script on the checkbox with the below code
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if(isLoading) {
return;
}
if(newValue == 'true') { //If checkbox is checked
g_form.setValue('<pass single line text variable name>', 'team possible');
} else {
g_form.clearValue('<pass single line text variable name>'); //If checkbox is empty clear the single-line text variable
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-25-2022 06:42 AM
Hi,
You can achieve it through catalog ui policy.
Create one catalog ui policy and give condition("checkbox is true").In UI policy actions make Single line text field visible true and readonly true. And write script to set Single line text value.
Mark as correct if it helps
Regards Mythily