Home » Developer & Programmer » Forms » set format mask dynamically in a single blok with 3 ssn
set format mask dynamically in a single blok with 3 ssn [message #180212] Fri, 30 June 2006 15:00 Go to next message
narasingu
Messages: 4
Registered: March 2005
Location: Hyderabad,AP,India
Junior Member
How can I set format mask in a detailed block dynamically
means if ssn = ssn format should be 111-11-1111
and if ssn=ein format sholud be 11-11111111
This is in detailed Blok
with 2 ssn and 1 Ein
Thx
Venkat
Re: set format mask dynamically in a single blok with 3 ssn [message #180244 is a reply to message #180212] Sat, 01 July 2006 09:34 Go to previous messageGo to next message
saadatahmad
Messages: 452
Registered: March 2005
Location: Germany/Paderborn
Senior Member

you can use:

IF ssn = 'ssn' THEN
 Set_Item_Property('BLOCK_NAME.item_name', FORMAT_MASK, 'your_format_mask');
ELSIF ssn = 'ein' THEN
 Set_Item_Property('BLOCK_NAME.item_name', FORMAT_MASK, 'your_format_mask');
END IF;


regards,
Saadat Ahmad

[Updated on: Sat, 01 July 2006 09:35]

Report message to a moderator

Re: set format mask dynamically in a single blok with 3 ssn [message #180845 is a reply to message #180212] Wed, 05 July 2006 08:32 Go to previous messageGo to next message
narasingu
Messages: 4
Registered: March 2005
Location: Hyderabad,AP,India
Junior Member
Hi,
This is not the way. I did it all. But it is not working. Since the "The number of Records Displayed = 3 " in Block Property. Hence when I use the set_Format_Mask,It is setting only for the first Record(or SSN) it is not setting Individually.
So hope Some body will me help me.
Thx
Venkat
Re: set format mask dynamically in a single blok with 3 ssn [message #180949 is a reply to message #180845] Wed, 05 July 2006 23:17 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Use a character text item instead of a numeric text item and do a to_char with the desired format into it in the Post-Query trigger.

David
Re: set format mask dynamically in a single blok with 3 ssn [message #181792 is a reply to message #180949] Tue, 11 July 2006 09:11 Go to previous messageGo to next message
narasingu
Messages: 4
Registered: March 2005
Location: Hyderabad,AP,India
Junior Member
Hi,
I still have problems with Format_Mask. I solved the 3 ssn porblem. Then again I have another problem with data input in SSN filed. When a user put a value like 111-11-1111/111111111 and queries, the form working fine and querying the data. But when user puts data in like 11-111111 format and queries, I am getting "FRM-40356 Invalid Number in example record.Query not issused." The format in ssn filed on property pallette is 099"-"99"-"9999.
Waiting for the answer.
Venkat
Re: set format mask dynamically in a single blok with 3 ssn [message #182275 is a reply to message #181792] Fri, 14 July 2006 01:41 Go to previous messageGo to next message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
You PMed me with
Quote:

Hi,
Thx for your resonose. I created D_SSN field for SSN field and made it Character field. The SSN field is Number field. I made D_SSN as visible in Canvas and SSN as Non_visisble.
Then I created Post-Query Trigg as follows:
D_SSN := SSN;
If Tin_tag ='E' Then
D_SSN := substr(SSN,1,2)||'-'||substr(SSN,3,7);
Else
D_SSN := substr(SSN,1,3)||'-'||substr(SSN,4,2)||'-'||
substr(SSN,6,4);
End If;

It seems to be working OK. But when if SSN =011-23-2345
then it is not doing correctly.
Could you help me out with this problem
Thx
Venkat
Why not remove all formatting in the pre-text-item trigger, then apply the formatting in a post-text-item trigger. You can use a 'rtrim' to remove any entered hyphens.

David
Re: set format mask dynamically in a single blok with 3 ssn [message #182935 is a reply to message #182275] Tue, 18 July 2006 15:17 Go to previous messageGo to next message
narasingu
Messages: 4
Registered: March 2005
Location: Hyderabad,AP,India
Junior Member
Yah!
It is not working properly. When I Queried with F7 Button it is showing all records, which is fine. When I querid with 1 value it is Pulling all values Instead of one value. I tried Pre-text-item & Post-item-trigger, but they are not working I believe.
I need help.
Re: set format mask dynamically in a single blok with 3 ssn [message #182966 is a reply to message #182935] Wed, 19 July 2006 00:05 Go to previous message
djmartin
Messages: 10181
Registered: March 2005
Location: Surges Bay TAS Australia
Senior Member
Account Moderator
Have you defined your Pre- and Post-Text-Item triggers to fire in enter-query mode?

David
Previous Topic: Convert data into HTML or EXCEL using Forms
Next Topic: Why Printer prints ASCII character in the Reports(10G) while calling from Forms10?
Goto Forum:
  


Current Time: Fri Sep 20 12:30:53 CDT 2024