Update field not showing in detail view

Discussions related to customizing hooks. Hooks are documented at http://bigprof.com/appgini/help/advanced-topics/hooks/
Post Reply
A Bindi
Posts: 9
Joined: 2018-01-04 18:45

Update field not showing in detail view

Post by A Bindi » 2019-06-11 10:55

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.

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 446
Joined: 2018-04-01 10:12

Re: Update field not showing in detail view

Post by pböttcher » 2019-06-11 15:35

Hi,

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

A Bindi
Posts: 9
Joined: 2018-01-04 18:45

Re: Update field not showing in detail view

Post by A Bindi » 2019-06-12 14:14

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.

pböttcher
AppGini Super Hero
AppGini Super Hero
Posts: 446
Joined: 2018-04-01 10:12

Re: Update field not showing in detail view

Post by pböttcher » 2019-06-12 20:04

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.

A Bindi
Posts: 9
Joined: 2018-01-04 18:45

Re: Update field not showing in detail view

Post by A Bindi » 2019-06-13 07:06

Ok, thanks

ALex.

Post Reply