,

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
 
 
, , , ,

How to Enable Personalization link for OAF Pages using Profile Options

To Access OAF Personalization in Oracle Apps, we need to set the values of following profiles options to enable Personalization Page link in OAF Pages. You can enable these profile options at all levels (Function, Site, Responsibility, User)


These four profile options are mandatory for working on OAF personalization in apps. To Assign these Profile Options, we need to go to System Administrator or Functional Administrator Responsibility.

Navigation:
System Administrator -> Profile -> System
Functional Administrator -> Core Services -> Profiles

Profile Name
Profile Value
FND: Diagnostics
Yes
Personalize Self-Service Defn
Yes
FND: Personalization Region Link Enabled
Yes / Minimal
Disable Self-Service Personal
No

Meanings:

1. FND: Diagnostics
Setting the FND: Diagnostics (FND_DIAGNOSTICS) profile option to “Yes” will enable the diagnostics global button to be rendered on the screen.

2. Personalize Self-Service Defn
Set the value to Yes to allow ‘Personalize’ link to appear at the right top of the OAF page.

3. FND: Personalization Region Link Enabled
It renders the “Personalize  Region” links above each  region in a page. Each link  takes you first to the Choose Personalization Context page, then to the Page Hierarchy Personalization page with focus on the region node from which  you selected the “Personalize  Region” link.

Two Options
Set the value to Yes to display all the personalization links above each OAF page region.
Set the value to Minimal to display key regional links.

4. Disable Self-Service Personal
Set the value to No will enable all OAF personalizations on all pages at all levels (Function, Site, Responsibility, User)