- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 03:40 AM
Hi All,
Location populated form level in request form view using client script but list view unable to see location field, it's showing empty in the list view.
Please suggest for this issue.
Thanks,
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 04:01 AM
Hi @ashok17 Ideally it should not behave like this. Try below code and see if it works
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '' || newValue == null) {
g_form.setValue('location', '');
return;
}
if (!g_form.hasField('location'))
return;
var caller = g_form.getReference('requested_for', setLocation);
}
function setLocation(requested_for) {
if (requested_for) {
g_form.setValue('location', requested_for.location);
g_form.setMandatory('location', true);
// Intentionally saving the form after setting the location
g_form.save();
}
}
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 03:50 AM
Hi @ashok17 can you share the client script you tried?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 03:53 AM
Below is the on change client script:
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
09-19-2024 04:01 AM
Hi @ashok17 Ideally it should not behave like this. Try below code and see if it works
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if (isLoading || newValue == '' || newValue == null) {
g_form.setValue('location', '');
return;
}
if (!g_form.hasField('location'))
return;
var caller = g_form.getReference('requested_for', setLocation);
}
function setLocation(requested_for) {
if (requested_for) {
g_form.setValue('location', requested_for.location);
g_form.setMandatory('location', true);
// Intentionally saving the form after setting the location
g_form.save();
}
}