DECLARE
vautogestao varchar2(1);
BEGIN
SELECT ind_autogestao
INTO vautogestao
FROM cm_contr_prest_serv_medico
WHERE id_contr = :con01.id_contr; -- this works
IF nvl(vautogestao, 'N') = 'S' THEN
:con01.ind_autogestao := 'Sim'; -- this works
set_item_property('CON01.BT_TIPO_ADEQUACAO', enabled, property_false); -- this NOT work
ELSIF nvl(vautogestao, 'N') = 'N' THEN
:con01.ind_autogestao := 'Não'; -- this works
set_item_property('CON01.BT_TIPO_ADEQUACAO', enabled, property_true); -- this NOT works too
END IF;
EXCEPTION
WHEN OTHERS THEN
sdalert.error('Erro: Problemas selecionando indicador de autogestão. Avise o responsavel!');
END;
My forms version is 6i.
The block "con01" and the item "bt_tipo_adequacao" exists. Whats is wrong?
Thanks!
maybe you should move those set_item_property comands to WHEN-NEW-RECORD-INSTANCE trigger of the same datablock.
Note: when you set the property 'enabled' to false, forms will automatically set the properties 'navigable' and 'update_allowed' to false. So, when you set 'enabled' property back to 'yes' you must set 'navigable' and 'update-allowed' to yes, as well.
if the code you shared is the same you are running, the only thing that could cause errors is datablock name or item name typed wrong.
if you have more code in the trigger, maybe the error is not in this statement.