Client Script Can Not Set Reference Field Value To Empty String In Portal
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-24-2020 01:08 PM
Hello Internet!
I am hoping to get some help from you regarding an issue that I am having.
My current version is Helsinki and unfortunately, I can not update to a never version.
I am currently working with the out of the box form widget in portal and I am trying to set a reference field to empty under certain conditions. In order to achieve this, I am doing the typical g_form.setValue('field_name', '');
However, this his method does not work for reference fields on the portal form widget. If I try to set any other field type to an empty string, it works just fine. If I try to set a reference field equal to any value that is not an empty string, it works just fine.
The error it is sending me is "scope.field.display_value_list is not defined".
Any advice is greatly appreciated! ❤️
- Labels:
-
Service Portal Development
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
01-27-2020 02:32 PM
Can you try g_form.clearValue(field_name);
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2020 11:45 AM
Hey Balaji!
Sorry for the late response. I tried g_form.clearValue(field_name); and it sent me the same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2020 12:42 PM
Hi ,
Use setTimeout function in script.
setTimeout(function() {
g_form.setValue('your field name',';);
}, 0);
Please mark it as helpful if it helps.
Thanks,
Sumanth
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-03-2020 01:10 PM
Hi Sumanth!
I gave this a try and unfortunately is still gives me the same error.