Home » Developer & Programmer » Forms » Format mask problem at Item Level . Intabular Form.
Format mask problem at Item Level . Intabular Form. [message #265717] Fri, 07 September 2007 02:43 Go to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

DECLARE
	v_len varchar2(25):=:uin;
	v_len1 varchar2(25);
	it_id Item;
BEGIN
	  it_id := Find_Item('uin');
    v_len1:=length(v_len);
    if v_len1 = 13 then
		set_item_property(it_id,Format_Mask,'FM99999"-"9999999"-"9');
    else
    	set_item_property(it_id,Format_Mask,'FM999"-"99"-"999999');
		end if;    	      
END;

--------------
this code is used on when_validate_item now problem is that when i give 13 digit code output is 12345-1234567-1 thats fine ..
and if code is 11 digit then output is 123-12-123456 but at same time field having 13 digit code converts to like ##########.How to handle two format masks on one item.
My form is tabular.
Using Forms 6i.
Re: Format mask problem at Item Level . Intabular Form. [message #265721 is a reply to message #265717] Fri, 07 September 2007 03:01 Go to previous messageGo to next message
Littlefoot
Messages: 21823
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Could it be because you are changing 'uin' item's property all the time, so 13-digit item is trying to be formatted to 11-digit format which fails and the result is bunch of #'s?
it_id := Find_Item('uin');
Re: Format mask problem at Item Level . Intabular Form. [message #265735 is a reply to message #265721] Fri, 07 September 2007 03:50 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

So how to handle it any idea?
Re: Format mask problem at Item Level . Intabular Form. [message #266192 is a reply to message #265735] Mon, 10 September 2007 02:52 Go to previous messageGo to next message
musman
Messages: 147
Registered: July 2007
Location: Lahore
Senior Member

PROCEDURE CALC_VALUE IS 
   new_value NUMBER;
   v_len varchar2(25); 
   BEGIN 
   	   new_value := TO_NUMBER(:System.current_Value);
   	   v_len := length(new_value);
   	   if v_len = 13 then
   	   	set_item_property(:system.trigger_item,Format_Mask,'FM99999"-"9999999"-"9');
   	   else
   	  
   	   	set_item_property(:system.trigger_item,Format_MAsk,'FM999"-"99"-"999999');
   	   	end if;
   	   --Copy(TO_CHAR(new_value), :System.Cursor_Item); 
   	   END;

--------
it try to do this with the logic like where is cursor is present now apply format mask ..
but still same problem..
any idea.
Re: Format mask problem at Item Level . Intabular Form. [message #266917 is a reply to message #266192] Wed, 12 September 2007 00:16 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
What is the 'width' and 'maximum length' of your item?

David
Previous Topic: How to run a query in Oracle form? (renamed by LF)
Next Topic: How to Run Forms from Internet
Goto Forum:
  


Current Time: Sun Feb 02 19:09:07 CST 2025