Home » Developer & Programmer » Forms » saving record (oracle8i & forms6i)
saving record [message #477641] Sat, 02 October 2010 22:23 Go to next message
ahmed_best2001
Messages: 10
Registered: October 2010
Junior Member
hi all,
i am using form6i & oracle 8i.
i have master -detail form. both are database blocks.
i have inserted values for the master block bt not for the detail record
my problem is..
"user should not be allowed" to move to next record of the master block before saving the current record

please help me

thanks

[Updated on: Sat, 02 October 2010 23:26]

Report message to a moderator

Re: saving record [message #477652 is a reply to message #477641] Sun, 03 October 2010 01:48 Go to previous messageGo to next message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Quote:

my problem is..
"user should not be allowed" to move to next record of the master block before saving the current record


Dear When user move From Master Block to Detail Block write trigger on Last item of Master Block as below.

Key-Next-Item
Commit;
Next_Block;




Hope this'll help you.

Regards,

Irfan
Re: saving record [message #477672 is a reply to message #477652] Sun, 03 October 2010 08:11 Go to previous messageGo to next message
ahmed_best2001
Messages: 10
Registered: October 2010
Junior Member
hi
Thanks for your reply..
bt dis is not helping sir....
wat if the detail block contains no record....
it is still allowing me to move to new record of master block which should not happen sir... Sad

Thanks
Re: saving record [message #477673 is a reply to message #477672] Sun, 03 October 2010 08:29 Go to previous messageGo to next message
ranamirfan
Messages: 535
Registered: January 2006
Location: Pakistan / Saudi Arabia
Senior Member

Also check Item where you write Key-Next-Item Trigger is the Last Item of Master Block and Also sets the Master block Navigation Style property to Change Data Block.


Regards,

Irfan
Re: saving record [message #477677 is a reply to message #477673] Sun, 03 October 2010 10:09 Go to previous messageGo to next message
ahmed_best2001
Messages: 10
Registered: October 2010
Junior Member
hi

thanks a lot sir for your reply

bt it is still not workin Sad

Thanks
Re: saving record [message #477683 is a reply to message #477677] Sun, 03 October 2010 12:21 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
What is the requirement, finally?

The first message says:message #1
"user should not be allowed" to move to next record of the master block before saving the current record


One of the next messages says:Quote:
wat if the detail block contains no record ... it is still allowing me to move to new record of master block

Could you explain once again what restrictions should be applied to navigation?
Re: saving record [message #477692 is a reply to message #477641] Sun, 03 October 2010 16:21 Go to previous messageGo to next message
ahmed_best2001
Messages: 10
Registered: October 2010
Junior Member
hi

Thanks for your reply..


well if i enter master & details record and move to next record i get a dialog from "form" which asks about saving the record...
dat is perfectly f9!!! Smile

"but prob is when user only enter the master record and navigate to next record without entering detail record" Sad

what i want is to prompt the user to enter details record & save the record before navigating to next record...

Hope i made u understand!!!


Thanks
Re: saving record [message #477710 is a reply to message #477692] Mon, 04 October 2010 00:46 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
A simple way to do that is to check whether detail block item (that is used to create a relation between master and detail block) is NULL.
-- WHEN-NEW-RECORD-INSTANCE on the master block

if :system.record_status in ('INSERT') then
   if :detail_block.relational_item is null then
     message('Detail block is empty!');
     raise form_trigger_failure;
   end if;
end if;

[Updated on: Mon, 04 October 2010 00:51]

Report message to a moderator

Re: saving record [message #477788 is a reply to message #477710] Mon, 04 October 2010 08:35 Go to previous messageGo to next message
ahmed_best2001
Messages: 10
Registered: October 2010
Junior Member
Thanks LF for your reply


bt it is still not working Sad
it is allowing me to navigate to next record Sad
let me explain u complete scenario again

i have dept(master) block & emp (detail)block joined based on deptno number.
now if dept & emp contains data then there is no prob bt prob comes when only dept data is entered & i navigate to next record without entering the emp data..."this particular thing should not happen"
my prob is only with navigation control..

Also

"if master block contains data & details does not contain data & when i try to save record.... i have done my validation for dis Smile "



bt real prob is of navigation Sad Sad
Re: saving record [message #477789 is a reply to message #477788] Mon, 04 October 2010 08:42 Go to previous messageGo to next message
cookiemonster
Messages: 13938
Registered: September 2008
Location: Rainy Manchester
Senior Member
Littlefoots code should fix that.
So what exact code did you write and what trigger did you put it in?
Re: saving record [message #477821 is a reply to message #477789] Mon, 04 October 2010 11:11 Go to previous message
ahmed_best2001
Messages: 10
Registered: October 2010
Junior Member
Trigger :"WHEN-NEW-RECORD-INSTANCE" of the dept(master) block

if :system.record_status in ('INSERT') then
   if :emp.deptno is null then
     message('Detail block is empty!');
     raise form_trigger_failure;
   end if;
end if;
end;



Thanks
Previous Topic: passing TWO parameters between two forms
Next Topic: Forms hangs with large text items (merged)
Goto Forum:
  


Current Time: Wed Sep 18 19:16:51 CDT 2024