Requirement – Have one program with 2 parameters. 1) Email Options and 2) Invoice Status  
                     Email option can be Yes or No – No will be default value 
                    Invoice Status can have Approved, Cancelled, Needs reapproval and Never approved options.
As per requirement  user should be able to pick any of 4 possible Invoice Status, if Email option is No but  in case if Email option is Yes
User should be restricted to select any value other than Approved. 
Solution –  This can be easily achieved if we create a custom table having invoice status values along with one additional column to map Email options value.                        
-          Create one custom table using below script 
CREATE TABLE O_APPROVAL_STATUS_TAB
(
  status_id                                NUMBER,
  inv_approval_status                             VARCHAR2(50),
  description                VARCHAR2(50),
  email_flag                 VARCHAR2(5)
)
/
GRANT ALL ON O_APPROVAL_STATUS_TAB TO APPS
/
insert into O_APPROVAL_STATUS_TAB values(10,'APPROVED','Validated','Y')
/
insert into O_APPROVAL_STATUS_TAB values(20,'APPROVED','Validated','N')
/
insert into O_APPROVAL_STATUS_TAB values(30,'CANCELLED','Calcelled','N')
/
insert into O_APPROVAL_STATUS_TAB values(40,'NEEDS REAPPROVAL','Needs Revalidation','N')
/
insert into O_APPROVAL_STATUS_TAB values(50,'NEVER APPROVED','Never Validated','N')
-          Create  custom value set O_APPROVAL_VS
   Go to Edit Information and select table name as O_APPROVAL_STATUS_TAB 
-          Set Where condition as  email_flag=$:FLEX$.Yes_No
-          Create one concurrent Program and define 2 parameters 
a)      Email Option              – Yes_No                                             ( Value Set )
b)      Invoice Status            – O_APPROVAL_VS                        ( Value Set ) 
-          Assign this program to any request group and validate the results
Output Validation – Run the program and change the Email option values Yes and No.
 
 
No comments:
Post a Comment