Sc_master with Form App. -> Grid Ap

I have an application Master ->Detail but the the detail app. is a Grid and not another Form.
I like to update de head form when I pusth a button in the the Grid app. but this not work
I have tried with this in ajax ajax event - click on the field.

$value = sc_format_num($_importe, ‘,’, ‘.’, 2, ‘S’, 1, ‘’);
?>

<?php but when I put any code any code in the ajax event, the apllication show un alert with any text, and don't execute the code. Thanks (my english is not goot but my portugueis is worse)

If the Master’s table field, which is
visually in the form is called: {VALUE_TOT_PRO}

You should do this:

$sql="
SELECT
	SUM(Total)
FROM
	adm_order_itens
WHERE
	OrderID = {OrderID}
";

sc_lookup(chk_ord, $sql);

if (!empty({chk_ord[0][0]})) {
    $_VALUE_TOT_PRO={chk_ord[0][0]};
} else {
    $_VALUE_TOT_PRO=0;    
}

$_VALUE_TOT_PRO=sc_format_num($_VALUE_TOT_PRO, ',', '.', 2, 'S', 1, '');

// UPDATES FIELD IN THE FATHER - HEAD VISUALLY
sc_master_value('VALUE_TOT_PRO', $_VALUE_TOT_PRO);

Use in the OnValidate Event.

Scriptcase Manual - English version USA.
https://www.scriptcase.net/docs/en_us/v9/manual/14-macros/02-macros/#sc_master_value

1 Curtida

the problem is that sc_master not work in Grid App. In my case the detail is a grid. My configuration is Master: Form Detail: Grid

This macro can only be used under these conditions, Watch the video:

1 Curtida

I have watched the vido. but in it only show un master(form app) a detail (form app.).
In my case as I told you, my Master(form app) and my detail (Grid app)
thanks