Home » Developer & Programmer » Forms » how can i change item lenght and how to block an item to update and new insert 6 (merged)
how can i change item lenght and how to block an item to update and new insert 6 (merged) [message #331005] Wed, 02 July 2008 02:11 Go to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
hellow

i have an item which is a db column, it is defined as varchar2(70). This item is a description item, until today i allowed the user to set description in this item with up to 70 characters but now i want to block this item that the users will be able to insert only descriptions with 40 characters long. I also dont want them to update it to more then 40 .

do i need to use "when-new-item-instance" trigger and to use the "set_item_property" command inside??


please help me

Ami
how to block an item to update and new insert [message #331007 is a reply to message #331005] Wed, 02 July 2008 02:18 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
hellow

i want to block an item (which is 70 characters long) for update and new item.
it is an item based on a db column ( it's a material description column ) untill todaye i allowed users to fill up to 70 characters in this filed and now i want to block this option and to allowed them to add max 40 to this filled when they are adding new description or updating on.
Do i need to use the trigger "WHEN-NEW-ITEM-INSTANCE" and in it the command "SET_ITEM_PROPERTY" ??? will it work both in update and new insert ?

please help

Ami
Re: how to block an item to update and new insert [message #331012 is a reply to message #331007] Wed, 02 July 2008 02:43 Go to previous messageGo to next message
wency
Messages: 450
Registered: April 2006
Location: Philippines
Senior Member

This is your second post! You don't know how to use this forum?

Place your trap on pre-insert and pre-update trigger of the block. You can also check the input length on when-validate-item trigger of that item.
Re: how to block an item to update and new insert [message #331055 is a reply to message #331012] Wed, 02 July 2008 04:12 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
do i uese set_item_propert in order to limit the size of the item?
how can i change item lenght (Merged) [message #331068 is a reply to message #331005] Wed, 02 July 2008 04:48 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
hi

i have item defined as varchar 60 i want to change its lenght to 30 when the user start to update this item

thanks
Re: how can i change item lenght [message #331099 is a reply to message #331068] Wed, 02 July 2008 05:39 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

Where u define in Form or Database.

kanish
Re: how can i change item lenght [message #331108 is a reply to message #331099] Wed, 02 July 2008 05:48 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
yes
Re: how can i change item lenght [message #331111 is a reply to message #331068] Wed, 02 July 2008 05:50 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

where
Re: how can i change item lenght [message #331117 is a reply to message #331111] Wed, 02 July 2008 05:54 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
what??????????????
Re: how can i change item lenght [message #331119 is a reply to message #331068] Wed, 02 July 2008 05:56 Go to previous messageGo to next message
mm_kanish05
Messages: 487
Registered: January 2007
Location: Chennai
Senior Member

where u define the item form/database

Re: how can i change item lenght [message #331136 is a reply to message #331119] Wed, 02 July 2008 06:06 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
its an item which is a DB column
its defined as varchar2(70)- its a material description column and i want to limit it to 40 characters when the user create a new item or blocking it when a user try to update the description to a description that is over 40 char ?
Re: how can i change item lenght [message #331260 is a reply to message #331136] Wed, 02 July 2008 15:29 Go to previous messageGo to next message
Littlefoot
Messages: 20891
Registered: June 2005
Location: Croatia, Europe
Senior Member
Account Moderator
Why is this database column VARCHAR2(70), but you want to restrict its length to 40 in front-end? That's, from my (current) point of view, a bad way of doing things.

The right way is to ALTER the table and shorten column's length to 40.
hot to set item length by code???? [message #331326 is a reply to message #331068] Thu, 03 July 2008 00:44 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
hi

i want to set an item lenght by code!!!! and not by using " property palette". i want to use it in the pre-insert/update trigger . i tried to use "set_item_property" but i didnt find any parameter that can solve my problem.
Please help me it is very important . Sad


thanks .
Re: hot to set item length by code???? [message #331347 is a reply to message #331326] Thu, 03 July 2008 01:32 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Don't start a new topic, just because you are not satisfied with the answers you get here, please.
Re: how can i change item lenght [message #331354 is a reply to message #331068] Thu, 03 July 2008 01:55 Go to previous messageGo to next message
averno9
Messages: 30
Registered: June 2008
Location: Spain
Member
Maybe he is saying that, in a particular form, he wants an input of 40 maximum, and in other form he would be able to put a 70 characters length. If you cannot ever input something of 70 characters, it's a waste of memory.

If that's what you are looking for, you could put a format mask in your field. If you want 40 letters maximum, put X in you format mask 40 times (i don't even know if you can put so many X). And if you want to be 40 letters or less, put FM and then 40 X. Maybe this last, will fill with blanks your string, or maybe if it's a VARCHAR2 it won't do that, i don't really know.
Re: how can i change item lenght [message #331365 is a reply to message #331354] Thu, 03 July 2008 02:28 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
Sorry, but this just does not make sense (to me). It sounds like a major error in design.
Sounds like we are trying to reuse a column for generic purposes: depending on the input of one column, the function of another column changes. That is a big no-no in relational databases!
Re: how can i change item lenght [message #331439 is a reply to message #331365] Thu, 03 July 2008 05:47 Go to previous messageGo to next message
nyc212
Messages: 14
Registered: May 2008
Junior Member
i will try to explin myself i want to let the user to enter only 40 characters despite the fact that the text item can get up to 70 char ( the text item is based on DB column that is varchar2(70)) and i want to limit the user to 40 char because i take the item he updated or insered from the oracle DB and load it to another DB there the same column is in type varchar2(40) and i want to limit the user insted of substructing the string he is inserting.
Re: how can i change item lenght (Merged) [message #331447 is a reply to message #331068] Thu, 03 July 2008 06:02 Go to previous messageGo to next message
averno9
Messages: 30
Registered: June 2008
Location: Spain
Member
To do that, put in your format mask FMXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX. (40 X letters) But, again, this is not a good solution. You should put two text items, one for the table with the field of 70 size, and another for the field of 40 size.

Don´t make things hard, when you can do them so easily. Time will bring you real problems that cannot be solved in a easy way, so relax until then.
Re: how can i change item lenght (Merged) [message #338152 is a reply to message #331447] Mon, 04 August 2008 00:38 Go to previous message
djmartin
Messages: 10180
Registered: March 2005
Location: Canberra ACT Australia
Senior Member
Account Moderator
Why not just test the length of the item in the 'when-validate-item' trigger and if it is greater than required then issue a message and do a 'raise form_trigger_failure' to stop further processing.

In the form make the display length less than the data length.

David
Previous Topic: FRM-41072: Cannot create Group REC_SHIFT_CODE
Next Topic: Closing Entire Application
Goto Forum:
  


Current Time: Sun Dec 04 13:00:08 CST 2016

Total time taken to generate the page: 0.08960 seconds