issue with post-query trigger [message #478953] |
Wed, 13 October 2010 14:14 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
Hi, i have an issue with post-query trigger.
i have a master block and a detail block.
i create a new record in master block, then i click an LOV button in detail block which inserts a record in the detail block.
there is one non database field in the detail block which i have to display value in depending on the value of one database item.
for example detail block is based on a table called temp_table
and its columns are id, age , emp, active.
and fields in the detail block are id, name, age, active.
of these id field is not displayed on the canvas.(note that name is non database item)
Name field is a column from some other table(EFG_tab)whose primary key is id. so when i give some value to the name field through the form i would be assigning the respective id value to the id field in when-validate-trigger.
when i query for a master record, or when i navigate to this form i want to display the name value of respective id in the Name field.
for this i wrote code in post-query trigger:
select name into :detail_blk.name
from EFG_tab
where id = :detail_blk.id;
but when i change the value of name and save , its working fine and saving record. but when i try to navigate out of the form its giving this message:
"do you want to save the changes you have made? "
how to avoid this ? i tried to suppress message but couldt solve.
why am i getting this message even after i saved the form ?
when i navigate to the detail block is the firing of post-query trigger assigning the value to the name field which in turn changing the form_status and asking me to save ??
i even tried to do this
if :system.form_status='CHANGED' then
commit_form;
end if;
in post-query trigger. it did not work either
thanks
jillu
|
|
|
|
|
Re: issue with post-query trigger [message #479249 is a reply to message #479200] |
Fri, 15 October 2010 09:41 |
nastyjillu
Messages: 211 Registered: February 2009
|
Senior Member |
|
|
but i want to validate the item. if i enter a wrong value then it should not allow me to insert that value.
as the value of non database item is being changed in the post-query trigger, record_status will be CHANGED and form is asking me to save changes. as this is a non database item i dont have to save. so i am chaning the record_status to 'QUERY_STATUS', so that it doesnt ask me to save.
|
|
|
|