Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Committing in more than one block, but keeping it to one alert

Status
Not open for further replies.

Cyntech

Programmer
May 29, 2003
1
AU
Hi, this one has me really stumped. It's in Oracle Forms 6i.

When I ask to commit changes to 2 blocks conveying some information, it's prompting me twice to save changes. I need to only have it prompt once.

I have 2 data blocks displaying information for a marker (I work for a Uni). The first block displays ID and Name, the second block (on the same area) displays their contact details.

When Key-Nxtblk is triggered, I currently check if anything has changed, if so, I do this:
Code:
clear_block(ask_commit);
execute_query;
go_block(block2);
execute_query;
go_block(nextblock);
execute_query;
The middle two lines seem to add the 2nd prompt to commit, but I Can find no other way to execute_query to the 2nd block if you click no on the prompt.

Any suggestions would be appreciated,

Thanks in advance.

Chris

Note: I changed the values in "go_block" for this post, so that is not an error there.
 
A commit in a form will affect the whole form.

Is it possible that some changes have been made in block 2? The 2nd execute query will query block 2 and ask for a commit if changes have been made in block 2.

Try this:

[tt]IF :SYSTEM.BLOCK_STATUS IN ('NEW','CHANGED')
THEN
clear_block(ask_commit);
ELSE
clear_block(NO_VALIDATE);
END IF;
--
execute_query;
go_block(block2);
Clear_Block(NO_VALIDATE);
execute_query;
go_block(nextblock);
Clear_Block(NO_VALIDATE);
execute_query;[/tt]
 
If the user responds "No" to the ask commit the execute_query will ask you again as it tries to clear the block in preparation to perform it's query. It appears that the code following the commit should be inside an "if" statement.

[sup]Everywhere is within walking distance if you have the time. ~Steven Wright[/sup]
Consultant/Custom Forms & PL/SQL - Oracle 8.1.7 - Windows 2000
[sup]When posting code, please use TGML to help readability. Thanks![sup]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top