Home » Developer & Programmer » Forms » data not saved
data not saved [message #467560] Mon, 26 July 2010 01:05 Go to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir i have a three blocks & three tables

1. master table composite primary key on(assm_no,assm_date)
2. a. input_detail table composite primary key on(assm_no,assm_date,input_item_code,process_code,fab_no)
b.input_detail table foreign key reference with master table

3. ouput detail table
foreign key references with master table

problem is
when form open master & input detail data auto coming

a., master table has one record.
b. input detail has two records.

c. output detail block data fetch according to input detail

means input detail has check box when we select one record & transfer record in output detail then data fetch in output detail block & saved

but if we select both records in input detail & trying to fetch in output detail then
data not saved in output block

first time data fetch in output detail but when cursor go back to input detail then output detail record also cleared

when i removed foreign key from output detail & then both records fetch in output block & saved
Re: data not saved [message #467565 is a reply to message #467560] Mon, 26 July 2010 01:40 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
There must be something wrong in checkbox manipulation. If it works fine for one checkbox, it should do the same for another.

Try to run a form in debug mode in order to see what is happening.
Re: data not saved [message #467572 is a reply to message #467565] Mon, 26 July 2010 02:00 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir i have debug this form & i observe

when data fetch in output detail block then cursor & loop working

first time data fetch in output detail for first record
when cursor go back to input block then primary key triggers &
constranit fires & output detail block records clared

go_block ('output_detail');
last_record

data fetch;

go_block ('input_detail');
down;

exit when input_detail.item_code is null

when we write this wording data is not fetch in output detail block for single record or multiple recod in both cases
Re: data not saved [message #467578 is a reply to message #467572] Mon, 26 July 2010 02:15 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
This:
go_block ('input_detail');
down;
causes the "third" block to be cleared (because of master-detail relationship). On the other hand, as "down" put focus on another record in the "second" block, you'd probably have to do the "data fetch" for that record (which would, I guess, populate the third block).
Re: data not saved [message #467579 is a reply to message #467560] Mon, 26 July 2010 02:23 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir can u explain in detail

because i cant understand third block relation with master block then why third block cleared when cursor go back to second
block for next record
Re: data not saved [message #467582 is a reply to message #467579] Mon, 26 July 2010 02:38 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Heh, I re-read your first message. It appears that the third block is a detail block of the first (master) block.

Somehow, I got the impression that third block's master block should be the second block ...

So: there's a master record. There's nothing to do with it.
A second block is master's detail block. It contains some "input" data. Every record in the second block has a checkbox. If it is checked, you'd want that record to appear in the third ("output") block. Right?

So, how about doing it this way: create a push button which would do the following: loop through all records in the second block. If the checkbox is checked, INSERT values into the third block's underlying table. Once the looping is over, go to the third block and execute query (so that inserted records appear in the third block).
Re: data not saved [message #467594 is a reply to message #467582] Mon, 26 July 2010 03:12 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir i m confused
actually i cant understand why this problem occured

i told in input detail block two records exists & both are checked

i have a push button when i press this button
loop & cusror working data fetch in output detail block for first record
but when cursor back to input detail block
output detail block records also cleared that will crate a problem for me

why is it link with master block because when i removed foreign key which is linked with master block then datasaved in output detail block
Re: data not saved [message #467599 is a reply to message #467594] Mon, 26 July 2010 03:27 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
I don't know why.

You said that you ran the form in debug mode. What caused records to disappear? Did you set a breakpoint early enough? Push button's trigger looks like a reasonably good spot.
Re: data not saved [message #467612 is a reply to message #467599] Mon, 26 July 2010 04:22 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir i think

when cursor go back to input detail block then on clear detail trigger fire & clear output detail block

so now i trying to solve it problem
Re: data not saved [message #467625 is a reply to message #467612] Mon, 26 July 2010 05:26 Go to previous messageGo to next message
Littlefoot
Messages: 21818
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
But, you said that the third block is a detail block of the first block. Did that trigger (ON-CLEAR-DETAILS) fire? It is a form-level trigger, isn't it? Should be, I think. If that's the case, it didn't even fire.

Though, debugger will know better.
Re: data not saved [message #467635 is a reply to message #467625] Mon, 26 July 2010 06:04 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir third block is linked with first block (master block)

when cursor fetch data in third block after that back to second block then primary key on second block fire then on clear detail triger fire & clear third block records also which is linked with master block

but if i remove foreign key of third block then there is no problem in third block or otherwise

if i commented on clear block trigger then also no problem
Re: data not saved [message #467636 is a reply to message #467635] Mon, 26 July 2010 06:09 Go to previous messageGo to next message
narang79
Messages: 137
Registered: June 2010
Senior Member
actually primary key of second block creating problem
because forth block which is linked with second block is also cleraed when data fetch for multiple records
Re: data not saved [message #467641 is a reply to message #467636] Mon, 26 July 2010 06:28 Go to previous message
narang79
Messages: 137
Registered: June 2010
Senior Member
sir can u solve my query

when cursor is going on that block where primary key exists then what happened

actualy i think it will cleraed all records which is linked with it.
Previous Topic: can we pass the data again to calling form?
Next Topic: How to read values in a multi record control block using Pre-insert trigger (block level)
Goto Forum:
  


Current Time: Fri Sep 20 03:38:52 CDT 2024