Form values are not visible on the list view

Community Alums
Not applicable

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. 

6 REPLIES 6

bradleydebono
Mega Guru

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

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. 

Community Alums
Not applicable

Hi @bradleydebono 

 

chanti1_0-1707302856890.png

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. 

 

 

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();
	}
}