copy built-in problem in forms6i [message #83640] |
Fri, 14 November 2003 05:14 |
mnunes
Messages: 1 Registered: November 2003
|
Junior Member |
|
|
i want to make a procedure that when i do a doble-click in a form form to checks if the field is "date" and puts the current date (sysdate) in field.
problem is when i use copy(built-in) it converts de format mask for it
PROCEDURE cg$duplo_click IS
w_item varchar2(50) := :system.current_block||'.'||:system.current_item;
w_item_id item := find_item(w_item);
item_invalido exception;
begin
if id_null(w_item_id) then
raise item_invalido;
end if;
if get_item_property(w_item_id,datatype) in ('DATE','DATETIME','JDATE','EDATE','TIME') then
if name_in(w_item) is null then
declare
w_formato varchar2(30) ;
w_valor varchar2(30) ;
begin
w_formato := get_item_property(w_item,format_mask);
w_valor := to_date(to_char(sysdate,w_formato),'yyyy-mm-dd');
-- w_valor is 2003-11-14
-- and
-- w_item is 0003-11-14 in form field
copy(w_valor,w_item);
exception when others then
message(sqlerrm||' - '||w_formato||' - '||w_valor,no_acknowledge);
end;
end if;
end if;
exception
when item_invalido then
message('Item Invalido - '||w_item,no_acknowledge);
end;
|
|
|