Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

text item set non-updateable but is updateable by sql code

Status
Not open for further replies.

prosuc

Programmer
Aug 14, 2002
53
CL
I have a text item named :table.item set :
UPDATE ALLOWED = YES
UPDATE ONLY IS NULL = YES

If the first time I enter data in the text item :table.item and commit, the second time I can't modify the item data, but if I press a button with the followin code:

:table.item:='0001';

Why Forms change the data commited in the item, if it isn't updateable??????

best regrads.

 
This property (as well as many others) restrics only user actions: you still can change values programmatically.

Regards, Dima
 
hi sem,
Thanks for your comments, but yet I have a dude....How if the item is NOT-UPDATEABLE by propertys I can control programmatically that pl/sql don't update the item????...I try to use the following function
GET_ITEM_PROPERTY('table.item',UPDATE_PERMISSION) but it don't work fine.

best regards.
Pablo
 
If you may set it to be not updateble, you may also not to update it :)

Regards, Dima
 
Hi sem,

really, I have the following problem, I re-use the demo "calendar" and make it a function, that can be used in any program with date items, this function are in a button to the right date item, but my problem is that the function calendar update my item non-updateable.

the pl/sql in the botton is :

TRIGGER WHEN-BUTTON-PRESSED

DECLARE
date_aux DATE;
BEGIN
-- in this point I need to know if the date item
-- :block.item is non-updateable and don't run then
-- function calendar

date_aux:=CALENDAR(SYSDATE);
-- open a form with the calendar ,
-- if the user do doubleclick in a day
-- I return the select date
IF date_aux IS NOT NULL THEN
-- update the item date
:block.item:=date_aux;
END IF;
END;

best regards,
Pablo
 
I didn't use this demo directly, only calendar form layout. In fact it has some limitations: the most annoying is that it can not be called in ENTER-QUERY mode. So I'd suggest you to either rewrite code or at least set calendar.writeable_flag to false before invoking it on read-only items.

Regards, Dima
 
hi prosuc,
You should query the required field from table before updation if it already contains value then update it with previous retrieved value else null means new value .u can add this code in your when_button_pressed trigger, suggested is to use this code in PRE_UPDATE trigger .
This code will update the value in every state but some times by new and sometimes by old value.

regards
Shahzad Zafar
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top