last checked record problem! [message #225975] |
Thu, 22 March 2007 02:41 ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
oracle06
Messages: 36 Registered: December 2005
|
Member |
|
|
Hello,
I have a multiple records block there are check boxes associated with each record,when I mark
the checkbox as checked and click on the save button then at the last checked record an error comes
'FRM-41050: you can not update this record',rest checked records successfully works.(problem is only with the last record.)
I am using key-commit trigger on this trigger I am calling save procedure in loop.
Code(Key-commit)trigger:-
go_block('bl_a1');
BEGIN
first_record;
loop
If :bl_a1.APPROVED= 'Y' Then
Save;
go_block('bl_a1');
END IF;
If :system.last_record = 'TRUE' then
Exit;
else
next_record;
END IF;
go_block('bl_a1');
end loop;
COMMIT_FORM;
END;
Please reply asap.
Thanks.
Upd-mod: Please use code tags.
[Updated on: Thu, 22 March 2007 17:20] by Moderator Report message to a moderator
|
|
|
|
Re: last checked record problem! [message #226227 is a reply to message #226209] |
Thu, 22 March 2007 23:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
oracle06
Messages: 36 Registered: December 2005
|
Member |
|
|
Code for save and C1 :-
PROCEDURE Save IS
Begin
IF Show_Msg('Sure you want to SAVE changes?.','YES_NO') = 1 Then
if :bl_a1.status = 'M' and :bl_a1.t_date is not null then
if Show_Msg('Want to Approve ?','YES_NO') = 1 then
:bl_a1.status := 'A';
end if;
end if;
if :bl_a1.t_date is null then
message('enter a valid date');
message('enter a valid date');
raise form_trigger_failure;
end if;
a1;
b1;
c1;
POST;
d1;
e1;
f1;
commit_form;
GO_BLOCK('bl_a1');
Else
clear_form(no_validate);
g1;
Message('Save Cancelled');
End If;
exception
when others then
message('cannot authorise'||' '||sqlerrm);
message('cannot authorise'||' '||sqlerrm);
raise form_trigger_failure;
End;
----------------------------********----------------------------
PROCEDURE c1 IS
v_gen varchar2(15);
BEGIN
if :bl_a1r.status = 'A' then
if :bl_a1.t_no is null then
v_gen := f_seq(to_char(:bl_a1.t_date,'dd/mm/rrrr'),:bl_a1.t_type,:global.c_code,:global.b_code);
end if;
end if;
If :bl_a1.APPROVED = 'Y' Then
go_block('bl_a2');
if :bl_a2.d_t_no =:bl_a1.d_t_no then
:bl_a2.t_no := v_gen;
:global.v_gen := :bl_a2.t_no;
end if;
:bl_a1.t_no:=v_gen; --------(here is the problem 'you can not update this record')
END IF;
EXCEPTION
WHEN OTHERS THEN
MESSAGE(SQLERRM);
MESSAGE(SQLERRM);
RAISE FORM_TRIGGER_FAILURE;
END;
Thanks.
[Updated on: Fri, 23 March 2007 05:20] Report message to a moderator
|
|
|
Re: last checked record problem! [message #226283 is a reply to message #226227] |
Fri, 23 March 2007 02:59 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
Frank
Messages: 7901 Registered: March 2000
|
Senior Member |
|
|
You DO realize that v_gen is null, don't you?
Is this really production code? With all the BS-names like c1, d1, bl_a1 etc??
Get rid of your exception handler in c1. It doesn't do anything Forms would not do automatically.
Is bl_a1.t_no updateable?
|
|
|
Re: last checked record problem! [message #226307 is a reply to message #226283] |
Fri, 23 March 2007 04:10 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
oracle06
Messages: 36 Registered: December 2005
|
Member |
|
|
Hello Frank,
- v_gen is not null,there is a value.
- Its a production code but actual names are different.
- bl_a1.t_no is updateable.
In the code
bl_a1 master block
bl_a2 detail block
Thanks.
|
|
|
|
|
|
|
Re: last checked record problem! [message #228433 is a reply to message #226932] |
Tue, 03 April 2007 01:04 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
oracle06
Messages: 36 Registered: December 2005
|
Member |
|
|
Hello David,
datatype for ":bl_a1.t_no" is char in t_no property,
and I am storing t_no value in a variable that is of varchar2(15).I have put the :-
message':bl_a1r.status=>'||:bl_a1r.status||'<, :bl_a1.t_no=>'||:bl_a1.t_no||'<');pause;' before the line that is failing.
Now it is giving messages "Please acknowlwdge" with the same 'FRM-41050: you can not update this record'.
Please tell me what the reason behind that message code you have said to put and what is the use of pause.
please response.
Thanks.
|
|
|
|
Re: last checked record problem! [message #228452 is a reply to message #228443] |
Tue, 03 April 2007 02:08 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
oracle06
Messages: 36 Registered: December 2005
|
Member |
|
|
Hello David,
I have put the message before that line where I am getting the error(I catched that code by running form in debug mode):-
message(':bl_a1r.status=>'||:bl_a1r.status||'<, :bl_a1.t_no=>'||:bl_a1.t_no||'<');pause;
:bl_a1.t_no:=v_gen;
Now it is giving messages
":bl_a1r.status=>A<,:bl_a1.t_no=>< "
"Please acknowlwdge"
with the same 'FRM-41050: you can not update this record'.
please response.
Thanks.
|
|
|
|
Re: last checked record problem! [message #228762 is a reply to message #228711] |
Wed, 04 April 2007 02:18 ![Go to previous message Go to previous message](/forum/theme/orafaq/images/up.png) ![Go to next message Go to next message](/forum/theme/orafaq/images/down.png) |
oracle06
Messages: 36 Registered: December 2005
|
Member |
|
|
Hello devid,
I have put the message before and after that line.Now I have selected 2 records by clicking on check box,the second record is my last selected(checked)record,here I am giving the results for both.
message(':bl_a1r.status=>'||:bl_a1r.status||'<, :bl_a1.t_no=>'||:bl_a1.t_no||'<');pause;
:bl_a1.t_no:=v_gen;
message(':bl_a1r.status=>'||:bl_a1r.status||'<, :bl_a1.t_no=>'||:bl_a1.t_no||'<');pause;
Now it is giving messages:
for first record:-
":bl_a1r.status=>A<,:bl_a1.t_no=>< " --before statement
":bl_a1r.status=>A<,:bl_a1.t_no=>20060802-00334< " --after statement
for second record (last checked record):-
'FRM-41050: you can not update this record'
":bl_a1r.status=>A<,:bl_a1.t_no=>< " --before statement
'FRM-41050: you can not update this record'
":bl_a1r.status=>A<,:bl_a1.t_no=>< " --after statement
Please response.
Thanks.
[Updated on: Wed, 04 April 2007 02:25] Report message to a moderator
|
|
|
|