I don't understand why
When I change the status from requested to canceled, the tool bar comes up a message
frm-40200:field is protected against update
Main Topics
Browse All TopicsI am developing a oracle form ( form version 11.0.0)
I created a list item named "status" on a form. There are 3 elements in the drop-down list
IN_PROGRESS','REQUESTED','
When the form opened, if To cancel a record, simply changed Requested to Cancelled. This is only allowed for records with a status of Requested. An error message will be given if attempted for other statuses.
Here is what I want to do
1. I want to create a trigger but I don't know which trigger is the best fit
when-mouse-click or when-list change
2. create the procedure
if' statu's field value is "requested' needed to canceled by selecting the drop-down list, do the update query.
if status field value is not "requested' and user wants to select the drop-down list to change something else, should come up a message can stop it.
How to develop this procedure?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
the too bar still saying "frm-40200:field is protected against update"
I add MESSAGE('end of when-list-changed',acknowl
....
ELSIF (:media_request_info.statu
MESSAGE('Are you sure you want to change the status?.');
END IF;
MESSAGE('end of when-list-changed',acknowl
Are block properties - insert_allowed, update_allowed set to property_true, too ?
Yes, they set all true.
I don't see "on formslevel" trigger.
But I add on-error, on_message with
message(:system.trigger_it
When I change status from requested to canceled,
first it pop up the message "Please acknowledge", in the tool bar it shows
MEDIA_REQUEST_INFO.STATUS:
When I remove message code instead putting "null;" into on-error and on-message, and change status from requested to canceled, I don't see any pup-up message and message in the tool bar.
So far the triggers for my media_request_info block are only on-error and on-message,
It seems I need key-commit, pre-insert, pre-update, pre-query, post-query... right?
"I don't see "on formslevel" trigger" - the triggers can be created
1) on forms level -> work for all form
2) on block level -> work for block
3) on item level -> work for item
I think that the primary problem is "MEDIA_REQUEST_INFO.STATUS
It seems that somewhere the update_allowed property has been changed.
I would try to put this in the beginning of when-list-changed trigger:
message(Get_Item_Property(
pause;
message(Get_Item_Property(
pause;
to see if update is allowed or no.
Henka:
I put your code in the beginning of when-list-changed trigger
It's still the same
first it pop up the message "Please acknowledge", in the tool bar it shows
MEDIA_REQUEST_INFO.STATUS:
flow01:
I put
message(:system.trigger_it
to on_error trigger on the form level.
It's still the same as above
I see a pop-up the message "Please acknowledge"
Did it show twice ?
add also
message(Get_Item_Property(
pause;
message(Get_Item_Property(
pause;
Check also for the property "update if null"
double-check the properties of item
MEDIA_REQUEST_INFO.STATUS
and of block MEDIA_REQUEST_INFO
check the item-property "Query Only"
There must be someting
Hi all,
I just find out something that may help you provide fix for me.
When I try to edit other fields such as ship_method, the tool bar comes up the following message
media_request_info.ship_me
and pup-up a message "Please acknewledge". When I click OK, the tool bar displayed another message
fm-41045:Cannot find item:invalid ID
Yes, for block media_request_info's base table is a view.
How to fix this?
Did it show twice ?
Yes
add also
message(Get_Item_Property(
pause;
message(Get_Item_Property(
pause;
First the toolbar displayed fm-41045:Cannot find item:invalid ID and pop-up"Please acknowledge". after click OK, again fm-41045:Cannot find item:invalid ID and pop-up"Please acknowledge"
Check also for the property "update if null"
Where is it? I don't find it
double-check the properties of item
MEDIA_REQUEST_INFO.STATUS
and of block MEDIA_REQUEST_INFO
check the item-property "Query Only"
status item-property "Query Only"=fasle
I increase point value to 150, since this Q becoming more difficult now
Is suppose you want to change the status column of one the tables in the view
2 options :
1)
create (in the database) an in-stead-of-trigger on de view that handles of the action to update the status
Then you can update a view with more tables (in sql or plsql).
But I don't remember if I used this feature also in a form : your message"cannot insert or update data in a view" is not promissing. For me the first possibilty to check is next monday.
2)
create a new item_list : status_update as a non_database_item
don't display your old item_list (make it also non-updatable)
in the post-query of the block make :status_update := :status
If the item-list is the only means of changing the status_update
add an update-statement in your item_list_changed trigger
update ...
set status = :status_update
where id = :id (id must be 1 or more columns in your block that uniq identify the record)
because the oracle-forms block hasn't changed in a database-related field there might be no action
when you hit commit (check).
In that case (no action) you have to create an 'on-key-commit'-trigger that fires a commit serverside.
FORMS_DDL('COMMIT'); -- Commit in the database independent of the form
You wil loose oracle forms behaviour like messaging 'Nothing to change' when you hit the commit and nothing has changed.
Because of these changes you know can't thrust on default oracle forms behaviour so you have to test your form very good.
I am trying 2) option. Here is what I put
create a new item_list : status_update as a non_database_item
--I created a new item status_update under media_request_block
don't display your old item_list (make it also non-updatable)
--I don't understand this point, I have status list item on the media_request_info block
in the post-query of the block make :status_update := :status
--I add a post-query trigger under media_request_block and put the the following code in this trigger
--:status_update := :status
If the item-list is the only means of changing the status_update
--Which list item? status_update or status?
add an update-statement in your item_list_changed trigger
--I added the following code to the status item list_changed trigger in media_request_info
update xx_upgrade_input_details xuid
set status = :status_update
where inventory_item_id = :licensed_products.invento
I cannot created the form
Compiling POST-QUERY trigger on MEDIA_REQUEST_INFO block...
Compilation error on POST-QUERY trigger on MEDIA_REQUEST_INFO block:
PL/SQL ERROR 49 at line 1, column 19
bad bind variable 'status'
PL/SQL ERROR 103 at line 2, column 1
Encountered the symbol "END" when expecting one of the following:
"." "(" "*" "%" "&" "=" "-" "+" ";" "<" "/" ">" "in" "mod"
"not" "rem" "an exponent (**)" "<> or != or ~=" ">=" "<="
<> "and" "or" "like" "between" "is null" "is not" "||"
"indicator"
; was inserted before "END" to continue.
Any thing wrong I did above?
The strategy is fetch your data by the view , update on separate columns.
MEDIA_REQUEST_INFO.STATUS is a data_base item and meant for fetching the status in your block (did you keep it ?)
MEDIA_REQUEST_INFO.STATUS_
Bij copying the data from STATUS to STATUS_UPDATE in the POST-QUERY you can show the status.
Updating STATUS_UPDATE does not result in a update of MEDIA_REQUEST_INFO (so there is no problem with the view).
When you change STATUS_UPDATE , you will have to code your own update statement.
About your compilation errors : dont forget the ; after :status;
MEDIA_REQUEST_INFO.STATUS must exists , but set display no or don't assign a canvas:
your status has to be visible and updateble by STATUS_UPDATE.
I wil also check next monday on possibilty 3)
Fetching and updating by procedures;
Update
I did not use the instead_trigger on a view in combination with updating in a oracle-form.
There is no experience by me or my collegues in using procedures for updating in forms.
So I can't advice further in the mentioned possibilities 1) and 3).
There is an interessing article in
http://www.dulcian.com/pap
but it states only to be used by an experienced developer.
I am trying your option 2). But I still cannot create the form.
Compiling POST-QUERY trigger on MEDIA_REQUEST_INFO block...
Compilation error on POST-QUERY trigger on MEDIA_REQUEST_INFO block:
PL/SQL ERROR 303 at line 1, column 1
qualifier 'MEDIA_REQUEST_INFO' must be declared
PL/SQL ERROR 0 at line 1, column 1
Statement ignored
In the post-query under media_request_info block, I put the following statement
media_request_info.status_
Is this an item
status_update in block media_request_info ?
It seems that you want to change the status of record programmatically.
If you want to test or set record status, then you ought to use
Get_Record_Property() built-in -> for testing
Set_Record_Property() built-in -> for setting
In the on-line help you can read more about these built-ins.
I have made something working now. I can save the changes whenever I made to the field. But, the list trigger still cannot function for what I want. When I change the list item from "in_progress" to "requested", it allows me to do that although it pops up message, but I can still save it. It shouldn't allow me to save it. In my when-list-changed trigger, I have the following code.
For example, when users change "in_progress" to something else like "requested", the message will be shown but also, the form should stop and cannot allow them to save.
To cancel a record, simply changed Requested to Cancelled. This is only allowed for records with a status of Requested. An error message will be given if attempted
for other statuses.
the status in "requested" changed to "in_progress" should be allowed
Please continue to help. Thanks
If you want stop the form and not allow saving then you ought to put testing
:media_request_info.status
in places where you want to save changes.
Also
IF (:media_request_info.statu
MESSAGE('The request is in procgress status and you cannot change.');
-- here you can disable save button
RAISE FORM_TRIGGER_FAILURE;
ELSIF (:media_request_info.statu
MESSAGE('The request has been canceled and you cannot change.');
-- here you can disable save button
RAISE FORM_TRIGGER_FAILURE;
ELSIF (:media_request_info.statu
MESSAGE('The request has been requested and you can only be changed to Canceled.');
-- here you can set properties of those items you don't want allow users to change
RAISE FORM_TRIGGER_FAILURE;
END IF;
Menu can be disabled by using
Set_Menu_Item_Property('me
2) You must know the previous state - if it was "requested" and user want to change it to "in_progress" then can look like this:
IF (:media_request_info.statu
IF <previous_state>='REQUESTED'
MESSAGE('The request is in procgress status and you cannot change.');
:media_request_info.status
RAISE Form_Trigger_Failure;
END IF;
ELSIF (:media_request_info.statu
MESSAGE('The request has been canceled and you cannot change.');
-- here you can disable save button
RAISE FORM_TRIGGER_FAILURE;
ELSIF (:media_request_info.statu
MESSAGE('The request has been requested and you can only be changed to Canceled.');
-- here you can set properties of those items you don't want allow users to change
RAISE FORM_TRIGGER_FAILURE;
END IF;
<previous_state> can be parameter or variable (defined in a package specification) in your form.
Before I remove some items, everything seems working. After I remove inventory_item_id on the media_request_info block, the list status can change whatever I want but with the following message
frm-40815:variable GLOBAL.status does not exist
If I add back the item - inventory_item_id to the block, everything seems working. I don't understand why. I don't need inventory_item_id on the block.
Here is my when-list-changed trigger code
Under block media-request_info, I have the following triggers
on-update
key-commit
pre-text-item
on-lock
post-change
Before I remove inventory_item_id, everything seems working. But, after I remove it, it comes up that error message and the status list doesn't following what I want.
Why?
How to fix it?
Business Accounts
Answer for Membership
by: wasabi3689Posted on 2009-01-07 at 09:44:23ID: 23317267
here is what I did but it doesn't work I created when-list-changed trigger with the following code
s = 'IN_PROGRESS') THEN
s = 'CANCELED') THEN
s = 'REQUESTED') THEN
IF (:media_request_info.statu
MESSAGE('The request is in procgress and you cannot change.');
RAISE FORM_TRIGGER_FAILURE;
ELSIF (:media_request_info.statu
MESSAGE('The request has been canceled and you cannot change.');
RAISE FORM_TRIGGER_FAILURE;
ELSIF (:media_request_info.statu
--the following will be a update query to make field value from requested to canceled only allowed
MESSAGE('are you sure you want to change.');
....
END IF;