Form values are not visible on the list view
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:04 AM
Hi All,
Having a requirement,
on the alm_license table we created a new custom field and tried to populate value the license allocated through onChange script based on the values of the total purchased rights and the available rights on the table.
that value we can see on the form view but the value we are populating there is not visible on the list view.
required suggestions.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:36 AM
Good day,
When you say it's no visible on the list view - Do you mean the new custom field is not visible at all? If so, you can add it via the cog icon in the top-right, then select it from the list.
Or do you mean that the column is visible in the list, but you cannot see anything in that field? If so, can you please provide a screenshot?
Many thanks,
Brad
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:38 AM
Also, you say you're populating the field based on an onChange script - Can you please copy the code in here?
There is a chance you're not actually saving the value that you're inserting. But I would need to see the script first.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 02:49 AM
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if ( newValue === '') {
return;
}
var rt = g_form.getValue('rights');
var ab = g_form.getValue('allocations_available');
var la = rt - ab;
if(rt == ab){
g_form.setValue('u_license_allocated', 0);
} else {
g_form.setValue('u_license_allocated', la);
g_form.setReadOnly('u_license_allocated',true);
}
//Type appropriate comment here, and begin script below
}
this one is dependent on the variable Allocations available.
Plese correct me if i'm not following the correct process.
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-07-2024 03:37 AM
You code is using "g_form.setValue()" to add values to this field. However this method doesn't actually SAVE those changes once it's made them.
You can use "g_form.save()" after in your script to save these changes. Or you can manually save the form. Please note, making changes on the client side and saving them will refresh the page, which can be a frustrating experience for the end user.
If you'd like to save your changes via the script, it will look something like this...
function onChange(control, oldValue, newValue, isLoading, isTemplate) {
if ( newValue === '') {
return;
}
var rt = g_form.getValue('rights');
var ab = g_form.getValue('allocations_available');
var la = rt - ab;
if(rt == ab){
g_form.setValue('u_license_allocated', 0);
} else {
g_form.setValue('u_license_allocated', la);
g_form.setReadOnly('u_license_allocated',true);
}
if (newValue != oldValue) {
g_form.save();
}
}