Monday, 11 September 2017

Fusion Related stuff: How to find the role of a user in fusion

SELECT r.*
FROM fusion.per_users u,
fusion.per_roles_dn_tl r,
fusion.per_user_roles ur,
fusion.per_all_people_f f
JOIN fusion.per_email_addresses e
ON e.person_id = f.person_id
AND e.email_address_id = f.primary_email_id
AND e.email_type = 'W1'
WHERE TRUNC(SYSDATE) BETWEEN f.effective_start_date AND f.effective_end_date
AND u.person_id = f.person_id
AND u.active_flag = 'Y'
AND r.role_id = ur.role_id
AND ur.active_flag = 'Y'
AND ur.terminated_flag != 'Y'

Friday, 24 March 2017

Attribute Level validation in AM and CO:

exceptions.add(new OAAttrValException(111, "XxdhPaContValueWorkDoneVO1", row.getKey(), "Description", row.getAttribute("Description"), "XXDH", "XXDH_PO_CLAIM_AMOUNT_MSG"));

Monday, 29 August 2016

How to get the data from different environments:


 
    public void getDatafromApps(){
        ResultSet resultset=null;
     
     
        try {
            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
            Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port:SID");
            Statement statement = conn.createStatement();
            String sql="select segment1,type_lookup_code from apps.po_headers_all where po_header_id=117";
             resultset = statement.executeQuery(sql);
            if(resultset.next())
                           {
                                System.out.println("-----------------------");
                                System.out.println(resultset.getString(1));
                                Segment1=resultset.getString(1);
                                System.out.println(resultset.getString(2));
                                System.out.println("-----------------------");
                             
                           }
        }
        catch (SQLException e) {
            System.out.println(e.getMessage());
        }
 
    }
 
 
    //get the SOA details
 
 
    public void getSOAData(){
 
            char quotes ='"';
            ResultSet resultset=null;
            try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port/serviceName");
                Statement statement = conn.createStatement();


                   String sql=    "select count(*) countOfrec    from SOA."+quotes+"_SAPTable"+quotes;
                   System.out.println(sql);
                   resultset = statement.executeQuery(sql);
                if(resultset.next())
                               {
                                    System.out.println("-----------------------");
                                    System.out.println(resultset.getString(1));
                                    countrec=resultset.getString(1);
                               
                                 
                                    System.out.println("-----------------------");
                                 
                               }
            }
         
            catch (SQLException e) {
                System.out.println(e.getMessage());
            }
                 
        }
How to get the data from different environments:


    //get the prod details
    public void getDatafromApps(){
        ResultSet resultset=null;
     
     
        try {
            DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
            Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port:SID");
            Statement statement = conn.createStatement();
            String sql="select segment1,type_lookup_code from apps.po_headers_all where po_header_id=117";
             resultset = statement.executeQuery(sql);
            if(resultset.next())
                           {
                                System.out.println("-----------------------");
                                System.out.println(resultset.getString(1));
                                Segment1=resultset.getString(1);
                                System.out.println(resultset.getString(2));
                                System.out.println("-----------------------");
                             
                           }
        }
        catch (SQLException e) {
            System.out.println(e.getMessage());
        }
 
    }
 
 
    //get the SOA details
 
 
    public void getSOAData(){
 
            char quotes ='"';
            ResultSet resultset=null;
            try {
                DriverManager.registerDriver(new oracle.jdbc.driver.OracleDriver());
                Connection conn = DriverManager.getConnection("jdbc:oracle:thin:user_name/password@//Host:port/serviceName");
                Statement statement = conn.createStatement();


                   String sql=    "select count(*) countOfrec    from SOA."+quotes+"_SAPTable"+quotes;
                   System.out.println(sql);
                   resultset = statement.executeQuery(sql);
                if(resultset.next())
                               {
                                    System.out.println("-----------------------");
                                    System.out.println(resultset.getString(1));
                                    countrec=resultset.getString(1);
                               
                                 
                                    System.out.println("-----------------------");
                                 
                               }
            }
         
            catch (SQLException e) {
                System.out.println(e.getMessage());
            }
                 
        }

Saturday, 27 August 2016

 to add fire action with param from controller:

Hashtable params = new Hashtable (1);
             params.put ("param1", pageName);
             Hashtable paramsWithBinds = new Hashtable(3);
           
             paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL(bandamActualFlag, "{$PoHeaderId}"));
             paramsWithBinds.put ("param3", new OADataBoundValueFireActionURL(bandamActualFlag, "{$LINE_LOCATION_ID}"));
           
             paramsWithBinds.put ("param4", new OADataBoundValueFireActionURL(bandamActualFlag, "{$bandamActualFlag}"));
             FireAction fireAction = OAWebBeanUtils.getFireActionForSubmit (bandamMHDDate, "bandamMHDDateEvent", params, paramsWithBinds,false, false);
               bandamActualFlag.setFireActionForSubmit("bandamActualFlagEvent",params, paramsWithBinds,true,true);
               bandamMHDDate.setPrimaryClientAction(fireAction);

 to add fire action with param from controller:

Hashtable params = new Hashtable (1);
             params.put ("param1", pageName);
             Hashtable paramsWithBinds = new Hashtable(3);
           
             paramsWithBinds.put ("param2", new OADataBoundValueFireActionURL(bandamActualFlag, "{$PoHeaderId}"));
             paramsWithBinds.put ("param3", new OADataBoundValueFireActionURL(bandamActualFlag, "{$LINE_LOCATION_ID}"));
           
             paramsWithBinds.put ("param4", new OADataBoundValueFireActionURL(bandamActualFlag, "{$bandamActualFlag}"));
             FireAction fireAction = OAWebBeanUtils.getFireActionForSubmit (bandamMHDDate, "bandamMHDDateEvent", params, paramsWithBinds,false, false);
               bandamActualFlag.setFireActionForSubmit("bandamActualFlagEvent",params, paramsWithBinds,true,true);
               bandamMHDDate.setPrimaryClientAction(fireAction);

Thursday, 28 July 2016

How to find the DFF column Names:

select distinct
fdfc.application_column_name attribute_no,
fdfc.end_user_column_name column1,
fdf.title,
fdfc.descriptive_flex_context_code dff_code,
fdf.application_table_name,
fdfc.display_flag Displayed,
fdfc.enabled_flag Enabled,
fdfc.required_flag Required1
from
apps.fnd_descriptive_flexs_vl fdf,
apps.fnd_descr_flex_col_usage_vl fdfc
where 1=1
and fdf.descriptive_flexfield_name=fdfc.descriptive_flexfield_name
and fdf.title like '%Vendor%Sites%'
---and fdf.descriptive_flexfield_name like '%PER_PEOPLE%'
and FDFC.DESCRIPTIVE_FLEX_CONTEXT_CODE='11565'
and FDFC.ENABLED_FLAG = 'Y'
---and fdfc.end_user_column_name like '%APPROVAL%STATUS%'
---order by FDFC.LAST_UPDATE_DATE desc