- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 07:53 AM
I have a table with 2 string fields as field1 and field2, and I have 2 choice fields as field3 and field4. Now when we make any changes in filed3 and field4 it should be copied to field1 and field2 respectivey. How can we do this using UI policy?
Thanks
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2022 12:06 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading ) {
return;
}
//Type appropriate comment here, and begin script below
g_form.setValue('field1',newValue);//sets value of field3 to field 1whenever field3 changes
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 08:21 AM
1.You need to write two UI policies in field 3 and field 4 with condition field3 changes and field 4 changes accordingly.
2.click on "advanced view" in related links
3. under script tab check run script.
4.In "Execute if true" write g_form.setValue('field1', g_form.getValue('field3'));
5. do same in other UI policy.
Raghav
MVP 2023
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 10:29 PM
@saini were you able to achieve this?
Raghav
MVP 2023

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-10-2022 08:55 AM
It is better to use onChange Client Script instead of UI policy.
1.Write two change Client scripts on Filed values Feild3 and Field 4.
2.In Script section you assign field1 = newValue; and Field2= newValue; respectively.
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue === '') {
return;
}
//Type appropriate comment here, and begin script below
g_form.setValue('field1',newValue);//sets value of field3 to field 1whenever field3 changes
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
‎11-12-2022 12:06 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading ) {
return;
}
//Type appropriate comment here, and begin script below
g_form.setValue('field1',newValue);//sets value of field3 to field 1whenever field3 changes
}