Tuesday, 21 August 2018

Delete switcher in oaf

Delete switcher in oaf

In this post , We will discuss about Delete switcher in oaf. Switcher regions is used to dynamically switch display items in the OAF page. With the help of Switcher region in oaf we can switch between multiple display items and only one item will be display between all the switch display items based on the conditions which will be true for specific item. In Delete switcher in oaf , we will dynamically display Delete Icons in the OAF page , which will be switch between the Switcher items so that it will be display one at same time. Here below is the Delete switcher in oaf complete Steps with working example.
 

Working Example of Delete switcher in oaf

Business Requirment :- We have Requirment , We have Supplier Delete page in OAF , but we want to enable the Delete icon only for that suppliers which have no AP invoices Open. So I have creates Procedure  XXSUPPLIER_INVOICE in which we pass Supplier No which returns 'YES' if that supplier does not have open invoices for payments but returns 'NO' if that supplier have open invoices for Payments.

Step1:- This is the Supplier Deletion Page , in this We have Delete Record Icon , Which will be Enabled and Disable based on the Conditions above.

Delete switcher in oaf


Step2:-First I need to find the VO object which is working for this Page, Here below is the VO and now I am adding the new Column which XXSUPPLIER_INVOICE in which we pass Supplier No which returns 'YES' if that supplier does not have open invoices for payments but returns 'NO' if that supplier have open invoices for Payments.

select SupplierNo,SupplierName,SupplierAlias,SupplierCreation_date,
Address1,Age,
DECODE(XXSUPPLIER_INVOICE(SupplierNo),'YES','DeleteEnable','DeleteDisable') as DeleteButton
from Ap_suppliers
where sysdate between start_date and nvl(end_date, sysdate)
Delete switcher in oaf


Step3:- Here below is the Table which is using in the Above OAF Page.
Delete switcher in oaf
 
Step4:-Now Right Click on the Table ==> Click New and Click Bew Column.
 
Delete switcher in oaf
 
 
 
Step5:- Now my New Column has been Created. Now Right Click on the New Column and Create Switcher as below.
Delete switcher in oaf
 
 
Step6:-As Below Region3 is my Switcher region created in the Last step
Delete switcher in oaf
 
 
Step7:- Now go to the Properties of the Switcher Region3 and Select the Column name which is created in the Step2 under the Existing VO.  'DeleteButton' is the VO Attribute.
 
Delete switcher in oaf
 
Step8:- You will notice a  <case> item being created under the Switcher Region.
Delete switcher in oaf
Now we have two conditions in which we want to Display the Delete Icon Enabled and Disabled. so We need to create another case 2.To Create New Case Right Click on the Switcher region , new and then Click Case.
 
 
Delete switcher in oaf
 
 
Step9:- Now Right Click on the First case and Create New Item as below.
Delete switcher in oaf
Step10:-
For the Second Item, Set the following Properties
          ID: DeleteEnabled
          Item Style: image
          Prompt: Delete
          Image URL: deleteicon_enabled.gif
          Rendered: True
 
Make sure you are giving the ID of the Item exactly matching with the View Attribute value being returned    by the "DeleteButton" in the Sql Query of VO
Delete switcher in oaf

 
 
Step11:- Same Like Above step , create new Item under the Second Case.
Set the following properties to the First Case Item.
          ID: DeleteDisable
          Item Style: image
          Prompt: Delete
          Image URL: deleteicon_disabled.gif
          Rendered: True
 
 
 

Delete switcher in oaf
 
Step12:- Delete Switched region in oaf is created as below.
 
Delete switcher in oaf
 

0 comments:

Post a Comment

Contact us for any Collaboration, Project Support & On Job Support Work

Name

Email *

Message *