Make Field protected against update [message #505167] |
Fri, 29 April 2011 13:24 |
|
praveenkumar2408
Messages: 5 Registered: April 2011
|
Junior Member |
|
|
Dear Experts,
I am new into Oracle Forms 6i and am in the process of learning. I have attached a POST-TEXT-ITEM Trigger below. What i am required to do is to protect a field 'COUR_CODE' from update when the SHIP_METHOD='R'. can any one of you help me with this below code on how to incorporate thsi change.
if :system.record_status = 'INSERT' then
declare
vcour_code ACCOUNTS.cour_code%type := NULL;
vcourier_account_no ACCOUNTS.courier_account_no%type := NULL;
canvas_name varchar2(30);
begin
select cour_code,courier_account_no
into vcour_code,vcourier_account_no
from accounts acct
where acct.no = :orde.acco_no;
if vcour_code is not null then
hide_view('CG$TAB_1');
:cg$ctrl.cg$stack_control := 'CG$TAB_2';
show_view('CG$TAB_2');
soft_messages('I',FALSE,'Customer''s courier preference is '||vcour_code|| ', Account: '||nvl(vcourier_account_no,'N/A'));
else
hide_view('CG$TAB_2');
:cg$ctrl.cg$stack_control := 'CG$TAB_1';
show_view('CG$TAB_1');
end if;
if :orde.shipping_method = 'R'
then next_item;
end if;
end;
end if;
Regards
Praveen.R
|
|
|
|
Re: Make Field protected against update [message #505173 is a reply to message #505170] |
Fri, 29 April 2011 14:51 |
|
praveenkumar2408
Messages: 5 Registered: April 2011
|
Junior Member |
|
|
Thanks..
if :system.record_status = 'INSERT' then
declare
vcour_code ACCOUNTS.cour_code%type := NULL;
vcourier_account_no ACCOUNTS.courier_account_no%type := NULL;
canvas_name varchar2(30);
begin
select cour_code,courier_account_no
into vcour_code,vcourier_account_no
from accounts acct
where acct.no = :orde.acco_no;
if vcour_code is not null then
hide_view('CG$TAB_1');
:cg$ctrl.cg$stack_control := 'CG$TAB_2';
show_view('CG$TAB_2');
soft_messages('I',FALSE,'Customer''s courier preference is '||vcour_code|| ', Account: '||nvl(vcourier_account_no,'N/A'));
else
hide_view('CG$TAB_2');
:cg$ctrl.cg$stack_control := 'CG$TAB_1';
show_view('CG$TAB_1');
end if;
if :orde.shipping_method = 'R'
then set_item_property('ORDE.COUR_CODE', NAVIGABLE, PROPERTY_TRUE);
set_item_property('ORDE.COUR_CODE', INSERT_ALLOWED, PROPERTY_TRUE);
SET_ITEM_PROPERTY('ORDE.COUR_CODE', UPDATE_ALLOWED, PROPERTY_FALSE);
SET_ITEM_PROPERTY('ORDE.COUR_CODE', REQUIRED, PROPERTY_FALSE);
end if;
end;
end if;
As you had adviced i tried the above SET_ITEM_PROPERTY built in. However still not working. Still i could see the 'LIST OF VALUES' when the CURSOR is at the field COURIER CODE.
Have i made any mistakes?
Regards
Praveen.R
|
|
|
|
|
|
|
|
|
|
|
|