Page 1 of 1

Update field not showing in detail view

Posted: 2019-06-11 10:55
by A Bindi
I have a field (string type) updated via hook with the concatenation of two other fields (eg: fullname = name + " " + surname) and I want display it only in the table view, but if I mark the "Hide in detail view [check]" the hook functions does not update it (it does not change his value).

Is it possible ? Is there a workaround ?

ALex.

Re: Update field not showing in detail view

Posted: 2019-06-11 15:35
by pbottcher
Hi,

can you post the code you are using. Are you using a combined tableview+detailview?

Re: Update field not showing in detail view

Posted: 2019-06-12 14:14
by A Bindi
Hi,

below the code in the table's hook:

Code: Select all

function AN_Software_before_update(&$data, $memberInfo, &$args){
	
		$nome_var = sqlValue("select Nome_Completo from AN_Software_Base where Id='{$data['Prodotto']}'");
		$data['Nome_Completo'] = ($nome_var . " Ver. " . $data['Versione']);
		
		return TRUE;
	}
It run perfectly except when the field "Nome_Completo" is hidden in detail view, in that case it does not appears in the detail view and does not change its content as it should do according with the table's hook commands.

The field "Nome_Completo" is a calculated field, so it is understandable that does not appears in the detail view, where the user believe believes to be able to modify it and can be confused.

ALex.

Re: Update field not showing in detail view

Posted: 2019-06-12 20:04
by pbottcher
Hi,

this is the way AppGini works. If you set a field to read-only or hidden in the detail view, AppGini will ignore that field for the sql calls to the database.
So you will not be able to manipulate the field via the $data array.
You could update the database directly, as you have all information needed.

Re: Update field not showing in detail view

Posted: 2019-06-13 07:06
by A Bindi
Ok, thanks

ALex.