Wednesday 30 October 2019

How To: Remove all rows from view object (VO) in OAF & ADF


Option 1: 

The executeEmptyRowSet() method can be used to empty the VO. This is my preferred approach.
/* Use the following snippet in the Application Module (AM) */
OAViewObjectImpl vo = this.getMyDummyVO();
vo.executeEmptyRowSet();

Option 2: 

Loop through the VO and remove each row. If the data set is too large this could be cost intensive. I do not prefer this option.
/* Use the following snippet in the Application Module (AM) */
OAViewObjectImpl vo = this.getMyDummyVO();
while(vo.hasNext()){
   vo.next().remove();
}

Monday 14 October 2019

Set Number Format in OAF



 //import oracle.cabo.ui.validate.Formatter; important Class for Formatting
 // Set Number fields Format
    public void setNumberFormatter(OAWebBean webBean) {

        Formatter formatter =
            new OADecimalValidater("###,###,##0.00", "###,###,##0.00");  // Formatter

        OAWebBean FarQuantity1_f = webBean.findChildRecursive("FarQuantity1");
        FarQuantity1_f.setAttributeValue(OAWebBeanConstants.ON_SUBMIT_VALIDATER_ATTR,
                                         formatter);

    }


Monday 7 October 2019

Storing Expression Value in PLSQL and Java

Every Expression return True or False.
So we can easily store their value in Boolean expression

Using this Method we can easily check conditions instead of testing these scenarios in IF-ELSE condition .

---Example of Storing Expression Value in PLSQL

---Example of Storing Expression Value in PLSQL
--By mFaisal
declare
lExpressionValue boolean;
begin
  --- Expression Value
  lExpressionValue:=1=2 or 2=2;
 
  -- Is True Then
  ---1
  ---else
  --2
 
if  lExpressionValue Then
    --1
  DBMS_OUTPUT.put_line('Expression is  True..');
  else
    --- 2
  DBMS_OUTPUT.put_line('Expression is not True..');
  end if;


end;



Example of JAVA Code


public class Server {
   


    public static void main(String[] args) {
        Server.isTrue((1==2));
//isTrue((1=1)));
    }

   
    public static void isTrue(boolean expression) {
    if (expression) {
       System.out.println("Expression is true.");
    }
    else
    {
        System.out.println("Expression is not true.");
    }
    }
   

   
}



OADBTransactionImpl in Oracle Application Framework (OAF)

OADBTransactionImpl is a class in Oracle Application Framework (OAF), which is a framework for building Oracle E-Business Suite applications...