We help IT Professionals succeed at work.
Get Started

how to convert this idea into a list trigger ? urgent needed!!

wasabi3689
wasabi3689 asked
on
560 Views
Last Modified: 2013-12-19
I create a block named "media_request_info". There is one item/field called "status" which is a list with 3 elements - requested, in_progress and canceled.

I create a when-list-changed trigger for the status list.
Under this trigger, I want the following ideas to be converted into code
1. when status is in_progress, canceled, user cannot change the list values to something else. If they change, there will be a message popped up to warn them.
2. when status is "requested", if user wants to change it to "canceled", this is allowed. There will be a message to tell them if it's sure to make this change. If click "Yes", it will go to call a procedure to update the table. Attached is my code, but I still cannot convert above ideas to the code completely. The code still doesn't work well and still can allow users to change status from in_progress to something else.

I am using orcle 8i and form version is 11.0.35
IF (:media_request_info.status = 'IN_PROGRESS') THEN
       MESSAGE('The media request is in progress status and you cannot change the status.');
        set_item_property ('status', ENABLED, PROPERTY_FALSE);
        RAISE FORM_TRIGGER_FAILURE; 
	--pause;
 
  ELSIF (:media_request_info.status = 'CANCELED') THEN
       MESSAGE('The request has been canceled and you cannot change the status.');
       set_item_property ('status', ENABLED, PROPERTY_FALSE);
 
  ELSIF (:media_request_info.status = 'REQUESTED') THEN
---I don't know how to do if user want to change to canceled, this is allowed.  but not --in_progress
       MESSAGE('The media has been requested and you can only change to canceled.');
      media_request_status_changed; 
   
 END IF;

Open in new window

Comment
Watch Question
CERTIFIED EXPERT
Commented:
This problem has been solved!
Unlock 1 Answer and 12 Comments.
See Answer
Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

  • Troubleshooting
  • Research
  • Professional Opinions
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE