frm 40105 setting item

Dicas do Oracle Forms Builder - Blocos, Itens, LOV, Canvas, Triggers, comandos, PLL, d2kwutil, FMB, Alert, menus, etc
Responder
flemej
Rank: Estagiário Júnior
Rank: Estagiário Júnior
Mensagens: 1
Registrado em: Qua, 30 Out 2013 11:25 am

Hi everybody!

I wrote this code in post_query trigger:

Selecionar tudo

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!
diegoBenetti
Rank: Estagiário Pleno
Rank: Estagiário Pleno
Mensagens: 4
Registrado em: Sex, 27 Set 2013 9:24 am

Good morning,

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.

regards,
Diego
Responder
  • Informação
  • Quem está online

    Usuários navegando neste fórum: Nenhum usuário registrado e 13 visitantes