, ,

R12 – java.sql.SQLException: Invalid column type in OAF

Issue:
When we are using view object (VO) in OA Framework it’s possible that you will run in to the problem java.sql.SQLException: Invalid column type, especially if it’s an LOV VO. When you click on the LOV torch for the first time it is working fine. But whenever when we click on the GO button in the LOV Region it gives an error.

Solution:
What we need to is, change the Binding Style from Oracle Named to Oracle Positional in the View Object declaration. The framework is adding a where clause to the query using bind variables that are typed :n, this is why you need to set Oracle Positional. Now save it run again, then it will solve this issue.

VO Binding Style

,

How to Find Duplicate Row in OAF Page?

How to Find Duplicate Row in OAF Page?

In this article, I have explained how to stop user to enter duplicate rows in OAF Page table region or advanced table region. This validation helps the users not to enter any duplicate record into system. Below method should be created in AM (Application Module) and it can be referred from CO.

Below method is used to compare rows from same VO Object with different VO instance. (mainVO and Subvo).

public void XXDuplicateVendorCharges() {

  OAViewObject mainVO =
  getXXVendorChargesEOVO1();
  OAViewObject Subvo =
  getXXVendorChargesEOVO1();

  for (Row row = mainVO.first(); row != null; row = mainVO.next()) {
    Number mainVOVendorChargesId = (Number)row.getAttribute("VendorChargesId");
    String mainChrgType = (String)row.getAttribute("VendorChargeType");

    for (Row row1 = Subvo.first(); row1 != null;
      row1 = Subvo.next()) {
      Number SubvoVendorChargesId = (Number)row1.getAttribute("VendorChargesId");
      String SubChrgType = (String)row1.getAttribute("VendorChargeType");

      if (!(mainVOVendorChargesId.equals(SubvoVendorChargesId))) {
        if ((mainChrgType).equals(SubChrgType)) {
          //Subvo.remove(); //remove the Child VO
          //getTransaction().commit(); // This performs the actual delete.
          throw new OAException("Duplicate row exists in Vendor Charges, select only unique Vendor Charge Type.",
                                        OAException.ERROR);
        }
      }
    } //SubVO
  } //MainVO
  mainVO.first();
  Subvo.clearCache();
}

Another Method to check duplicate from DB Object like below.

public void XXDuplicateVendorCharges() {

    OAViewObject VendorHdrVO = getXXVendorHeaderEOVO1();
    Row VendorHdrRow = VendorHdrVO.getCurrentRow();

    try {
        if (VendorHdrRow != null) {
            VendorHdrId = (Number)VendorHdrVO.getAttribute("VendorHdrId");
        }
    } catch (Exception exec) {
        throw new OAException("Error: " + exec, OAException.ERROR);
    }

    OAViewObject mainVO =  getXXVendorChargesEOVO1(); 
    XXVendorChargesEOVOImpl Subvo = 
        (XXVendorChargesEOVOImpl)this.findViewObject("getXXVendorChargesEOVO2"); //Child VO for duplicate checking
        
    if (Subvo == null) {
        Subvo = (XXVendorChargesEOVOImpl)this.createViewObject("getXXVendorChargesEOVO2", 
                                                                   "xxerp.oracle.apps.po.customapp.server.XXVendorChargesEOVO");
    }
    Subvo.clearCache();

    if (!(Subvo.isPreparedForExecution())) {
        Subvo.setWhereClause(null);
        Subvo.setWhereClause("VENDOR_HDR_ID= " + "'" + VendorHdrId + "'");
        Subvo.executeQuery();
    }


    for (Row row = mainVO.first(); row != null; row = mainVO.next()) {
        Number mainVOVendorChargesId = 
            (Number)row.getAttribute("VendorChargesId");
        String mainChrgType = (String)row.getAttribute("VendorChargeType");
       
        for (Row row1 = clonevo.first(); row1 != null; 
             row1 = Subvo.next()) {
            Number SubvoVendorChargesId = 
                (Number)row1.getAttribute("VendorChargesId");
            String SubChrgType = (String)row1.getAttribute("VendorChargeType");

            if (!(mainVOVendorChargesId.equals(SubvoVendorChargesId))) {
                if ((mainChrgType).equals(SubChrgType)) {
                    //Subvo.remove(); //remove the Child VO
                    //getTransaction().commit(); // This performs the actual delete.
                    throw new OAException("Duplicate row exists in Vendor Charges, select only unique Vendor Charge Type.", 
                                          OAException.ERROR);
                }
            }
        } //Subvo
    } //MainVO
    mainVO.first();
    Subvo.remove();
}

 

, , , ,

Solved: You cannot run a page which is not Self Secured when the MAC fails

Sometimes we will face below issues in R12.

Issue 1:
You have insufficient privileges for the current operation. Please contact your System Administrator.

You cannot run a page which is not Self Secured when the MAC fails.

Resolution:
 
Set the below 3 profiles to None
1) FND Function Validation Level
2) FND Validation Level
3) Framework Validation Level
JDev-2
Issue 2:
Unexpected URL parameters have been detected and will be ignored Solution:
 
Resolution:

In JDeveloper, go to menu Tools–>Embedded OC4J Server Preferences–>Global–>Startup–>Select Default Local IP Address.
JDev-3