Subpanel calculate value from two fields

You need to include those fields as ‘query_only’ in the subpanel definitions.

For example, if the module is Contacts, you would have those definitions in

custom/modules/Contacts/metadata/subpanels/some_name.php

and fields can either be an actual part of the subpanel (showing as columns) or ‘query_only’ meaning you need to use them but not show them.

Here’s a segment of an example file with one field as ‘query_only’:


$subpanel_layout['list_fields'] = array (
		
	'first_name' => 
		array (
                       'name'=>'first_name' 
			'usage' => 'query_only', 
		), 
	'photo' =>
	array (
			'name' => 'photo',
			'vname' => 'LBL_PHOTO',
			'width' => '5%',
			'default' => true,
	),

Also, check out the customCode in this same file, it let’s you easily put together field values.

1 Like