Tuesday, November 9, 2021

Oracle Apex 21.2 Installation & ORDS Configuration


 1.@apexins.sql sysaux sysaux temp /i/

2.@apxchpwd.sql

3.@apex_rest_config.sql

4. Unlock All Locked User :      select username,account_status from dba_users  where username like 'APEX%';
select username,account_status from dba_users  where username like  'ORDS%';
or

select username,account_status from dba_users where lock_date is not null and username like 'APEX%'; )

For Oracle Database version 12c or later run the below script:

BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => '*',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => 'APEX_210100',
principal_type => xs_acl.ptype_db));
END;
/ BEGIN
DBMS_NETWORK_ACL_ADMIN.APPEND_HOST_ACE(
host => 'localhost',
ace => xs$ace_type(privilege_list => xs$name_list('connect'),
principal_name => 'APEX_210100',
principal_type => xs_acl.ptype_db));
END;
/ EXEC DBMS_XDB.sethttpport(0);


#unzip ords file :

    copy the images folder from the apex directory and paste it to ords folder.

Download Link :
jdk-https://www.oracle.com/java/technologies/javase-downloads.html

Ords-https://www.oracle.com/database/technologies/appdev/rest-data-services-v192-downloads.html

Ords Run Command:

Set path=C:\Program Files\Java\jdk-18.0.2.1\bin
java -jar ords.war serve
java -jar ords.war --config  D:\Oracle\ords\config serve

Internal User Unlock & Password change:

First need to log in Oracle sys user.

SELECT TO_CHAR(user_id),
first_name,USER_NAME,
last_name,
default_schema
FROM wwv_flow_fnd_user
WHERE user_name = 'ADMIN'
ORDER BY last_update_date DESC;

ALTER SESSION SET CURRENT_SCHEMA = APEX_190200;

begin
wwv_flow_security.g_security_group_id := 10;
wwv_flow_fnd_user_api.UNLOCK_ACCOUNT('ADMIN');
commit;
end;

UPDATE wwv_flow_fnd_user
SET web_password = 'Enter your password'
WHERE user_name = 'ADMIN'
AND user_id =1200348866127291;

What's New in Oracle APEX 21.2


 1. Smart Filters : Smart Filters is a new search component that allows users to quickly narrow data down with filters suggestions or search items. In Smart Filters include -Powerful Search Bar, Search Suggestions, Suggestion Chips.

2.Progressive Web Apps : APEX apps can easily be defined as Progressive Web Apps (PWAs) to take advantage of advanced caching and improved performance. These apps can also be installed on  smartphone of choice with device-specific installation instructions. Progressive Web Apps Include-
App Performance, Apex Application Instable, Custom Offline Page.

3. Universal Theme & UI Updates : The updated Reference App now provides live Template Option previews, documented CSS variables, and a new Theme Version menu in the header to quickly jump to Reference Apps for previous versions of the Universal Theme. New updates are- Greater Flexibility in Page Layouts, Model Dialog Drawers, Accessibility Improvements, Faster Page Rendering.

4. New & Updated Components :
    1.Faceted Search Enhancements : Multi-Value Facets, Additional UI Controls, 
        Accessibility Improvements.

    2. Update Alert and Confirm Dialogs : Customizable Dialogs, Support for Template Directives, Button Confirmation.

5.Geocoding and Map Items : Geocoding your addresses has never been easier, and you can even display a map as a page item . The best part is that you don't need an API key.

6.REST Catalogs and Improvements : 
    1. Search Catalogs Across Apps.
    2. Easy Export and Import.
    3.URL-based Updating.
    4. Pagination Support for REST Services.

7. Improved Report Downloads, Subscriptions, and Printing :
    1. Images in Report Downloads.
    2. Download Dialog Improvements.
    3.Interactive Report Subscriptions.

8. Developer Experience :
    1.Improved Editors :Static File Editor, Improved Breadcrumb Editor, Run Larger SQL in SQL Commands (SQL Commands now supports  more than 32k characters).

9. Email and Email Template Enhancements :
    1. Email Support in Automations.
    2.Copy Email Templates.
    3. Inline Email Attachments.

10. Additional Features :
    1.Data Packager.
    2. Popup LOV Set Display Value.
    3. New Date Picker 'Show-On' attribute.
    4. New Modal Dialog Event.
    5.Copyright Banner in App Exports.
    6.New PL/SQL APIs.
    7. New JavaScript APIs.
    8.Build Apex Apps in 21 additional Language.
    9. JavaScript Library Upgrades.


Oracle Apex Uninstall Process


Oracle Apex Uninstall : 

First we need to go to Apex Folder & Connect Database Using SQL Plus Or  CMD.
Then Execute These Command:  @apxremov_con.sql                                                 OR @apxremov.sql


Sunday, September 19, 2021

Parent Page Refresh After Model Page Close

 1. First we need to create Dynamic Action In Parent Page.

            Event : Dialog Close
            Selection Type : Region
            Region : Select Specific Region

Create True Action :
        Action : Close Dialog

Create another True Action :
       Action : Refresh
      Selection Type : Region
     Region : Select Specific Region

2. After That we need to create Process in Model Page .
        Name : PageClose(Give a meaningful Name )
        Type : Close Dialog
    Server Side Condition:
        Type : Request is contained in Value
        Value :Shift_Update(Update Button Name)

Friday, July 30, 2021

Custom Chart & Custom Chart Color In Oracle Apex


 From Chart Attribute In Advance Option

JavaScript Initialization Code Section add Following Code :
========================================

function (options){

  function (options){

    options.dataFilter = function (data){

        data.series[0].color = "green";

        

        data.series[1].color = "red";

        data.series[2].color = "blue";

        data.series[3].color = "Yellow";

        data.series[3].color = "gray";

        return data;

    };

  // Add new 3D effect to existing chart style defaults   

     options.styleDefaults.threeDEffect = "on";

     return options;

    //options.styleDefaults = $.extend( options.styleDefaults, {threeDEffect: "on"});

   // return options;

}


Classic Report Background Color Change (Based On Condition)


 1. Create Dynamic Action 

       => Execute JavaScript Code

Add Following Code in to Execute JavaScript Code Section:
=============================================

$('td[headers="ENTRY_STATUS"]').each(function() {  

  if ( $(this).text() === 'Weekend' ) {

    $(this).closest('tr').find('td').css({"background-color":"rgb(37 90 185 / 68%)"});

      $(this).closest('tr').find('td').css({"color":"black"});

      $(this).closest('tr').find('td').css({"font-weight":"bold"});

      $(this).closest('tr').find('td').css({"border":"1px solid #D6EAF8  !important"});

  }

   if ( $(this).text() === 'Govt. Holiday' ) {

    $(this).closest('tr').find('td').css({"background-color":"#4FA64F "});

      $(this).closest('tr').find('td').css({"color":"black"});

       $(this).closest('tr').find('td').css({"font-weight":"bold"});

      $(this).closest('tr').find('td').css({"border":"1px solid #D6EAF8  !important"});

  }

  if ( $(this).text() === 'Present' ) {

    $(this).closest('tr').find('td').css({"background-color":"ghostwhite"});

    $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

  if ( $(this).text() === 'Late' ) {

    $(this).closest('tr').find('td').css({"background-color":"#997570"});

      $(this).closest('tr').find('td').css({"color":"white"});

      $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

    if ( $(this).text() === 'Absent' ) {

    $(this).closest('tr').find('td').css({"background-color":"#E8453A"});

        $(this).closest('tr').find('td').css({"color":"white"});

        $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

    if ( $(this).text() === 'Leave' ) {

         $(this).closest('tr').find('td').css({"background-color":"yellow"});

         $(this).closest('tr').find('td').css({"color":"black"});

         $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

    

  if ( $(this).text() === 'Short Leave' ) {

        $(this).closest('tr').find('td').css({"background-color":"cadetblue"});

        $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

 if ( $(this).text() === 'Tour' ) {

    $(this).closest('tr').find('td').css({"background-color":"#117A65"});

    $(this).closest('tr').find('td').css({"color":"white"});

    $(this).closest('tr').find('td').css({"font-weight":"bold"});

  }

});

Sunday, July 4, 2021

Condition Based LOV(List of Value) In Oracle Apex



 List of Value Type: Pl/SQL Function Body Returning SQL


Declare 

  v_type varchar2(1) := :P45_RETURN_TYPE;

 Begin

  If v_type = 'C' then

    Return 'SELECT CUSTOMER_ID R,CUSTOMER_NAME D,CUSTOMER_NAME,CUSTOMER_PHONE,CUSTOMER_ADDRESS

            FROM CUSTOMER_INFORMATION WHERE CUSTOMER_ID IN(SELECT CUSTOMER_ID FROM INVOICE_MASTER)'

                 -- where some_column = ''CONDITION 1''

                  ;

  Else

     Return 'SELECT SUPPLIER_ID R,SUPPLIER_NAME D,SUPPLIER_NAME,SUPPLIER_PHONE,SUPPLIER_ADD

             FROM SUPPLIER_INFORMATION WHERE SUPPLIER_ID IN(SELECT SUPPLIER_ID FROM PRODUCT_RECEIVE_MASTER)'

                  --where some_column = ''CONDITION 2''

                  ;

  End if;

End;

Friday, December 11, 2020

Run Time Validation Check Without Page Submit In Oracle Apex


1.Ajax Callback :
 First we need to create Ajax Callback Process & give a meaningful name of this process. The Process like Bellow........... 

 Begin

    If :P9_QUANTITY is null Then

        htp.prn('Please Input Invoice Quantity.');

    Elsif :P9_QUANTITY =0  Then

        htp.prn('Sorry,Invoice Quantity Should be greater Than 0.');

    Else

        htp.prn('SUCCESS');

    End If;

End;


2. Dynamic Action : Create Dynamic Action in Item Level where we want to execute Validation.

apex.server.process('InvoiceQuantityValidation',
{
   pageItems : '#P9_QUANTITY'
}
,
{
   dataType : 'text', success : function(data)
   {
      if(data != 'SUCCESS') apex.message.alert(data);
   }
}
)

Wednesday, December 9, 2020

Digital Clock Create In Oracle Apex


Create Function In Function and Global Variable Declaration :

function showTime(){
    var date = new Date();
    var m=date.getMonth("MON");
    var dd=date.getDate();
    var y=date.getFullYear();
    var h = date.getHours(); // 0 - 23
    var m = date.getMinutes(); // 0 - 59
    var s = date.getSeconds(); // 0 - 59
    var session = "AM";
     if(h == 0){
        h = 12;
 }
   if(h > 12){
        h = h - 12;
        session = "PM";
    }
    
    h = (h < 10) ? "0" + h : h;
    m = (m < 10) ? "0" + m : m;
    s = (s < 10) ? "0" + s : s;
    
    //var time =dd +""+ m +"" + y +","+ h + ":" + m + ":" + s + " " + session;
    var time = h + ":" + m + ":" + s + " " + session;
    document.getElementById("MyClockDisplay").innerText = time;
    document.getElementById("MyClockDisplay").textContent = time;
    setTimeout(showTime, 1000);
   }

$(document).ready(function(){
 
    $(".t-Body-contentInner").prepend("<div id='MyClockDisplay' class='clock'></div>");
     showTime();
});

Inline :

body {
    background: black;
}
.clock {
    position: relative;
    left: 95%;
    transform: translateX(-50%) translateY(-50%);
    color: darkslategrey;
    font-size: 14px;
    font-family: Orbitron;
    font-weight: bold;
    letter-spacing: 4px;
}

Tuesday, December 8, 2020

Custom Authorization In Oracle Apex

 In this article we are going to discuss about Oracle APEX Authorization and Custom Authorization. Oracle Application Express (APEX) has two mechanisms for providing system security to be implemented on its application. The two mechanisms are authentication and authorization. Authentication mechanism  is implemented on login page. Authorization is used to create deeper security control. It might implemented on tab, page or region. The combination usage of authentication and authorization will create an application with confidence security.


On Oracle APEX we can create two kinds of authorization. We can create authorization with Access Control List (ACL) or with custom authorization.In this article we will discuss about custom authorization in oracle apex.

Page Level Authorization Query:

SELECT PAGE_NO FROM MENU_INFO WHERE MENU_NO IN(SELECT MENU_NO FROM MENUPREVS_DETAIL WHERE ROLE_NO=(SELECT USER_LEVEL FROM USER_INFORMATION WHERE LOGIN_NAME=:APP_USER)) AND
PAGE_NO=:APP_PAGE_ID;



Tuesday, October 20, 2020

New Feature of Oracle Apex 20.2


 

Cards Region

The new Cards Region is a lightweight report region, declaratively supporting customizations of layout, appearance, icon, badge, media and actions. Use cards to embed and share media sourced from BLOB column, URL or video in iFrame. Cards are useful for presenting a variety of information in small blocks. As Cards usually provide entry to more detailed information, you can include a number of actions as button or links declaratively.

Redwood UI

Universal Theme now supports a new Redwood Light theme style, available via Theme Roller. Refresh your existing apps to uptake the latest version of Universal Theme and this new theme style.

New and Improved Items

  • New Checkbox item type. This single checkbox offers an alternative to the Switch item type for Boolean columns. Works in Interactive Grid as well, even when not in edit mode. The previous Checkbox type has been renamed to Checkbox Group.
  • File Browse item type has been enhanced to support rendering as a drop zone, supporting the drag & drop of a file to be uploaded.
  • Rich Text Editor item type has been upgraded to use CKEditor 5 and now supports markdown output.
  • Text Field item type has a new Text Case setting to optionally transform the user-entered text to upper or lower case.
  • The Text Field Trim Spaces and Text Case settings and Textarea Trim Spaces settings are now applied on the client as well as the server.

Faceted Search Enhancements

  • Bar or pie charts of facet value counts. Quickly display a chart of facet value counts in a dialog or 'dashboard' area.
  • Groups of checkbox facets for Boolean columns. Checking the facet will find records that match the 'yes' or 'true' value of the column.
  • Input Field facet type supports comparing a user-entered value with the facet column. This enables faceted searches such as finding stores within a user entered number of miles or records where a column contains the user entered text.
  • Performance optimization for distinct value facets.

Report Printing

  • Built-in PDF printing and Excel download for Interactive Reports, Interactive Grids and Classic Reports. Make sure to enable PDF and Excel as additional download format in your region attributes. Users can change the page orientation and size in the download dialog.
  • Interactive Report - Send E-Mail: All download formats can now be attached.
  • Enhanced integration with BI Publisher.
  • New APEX_REGION.EXPORT_DATA and APEX_DATA_EXPORT APIs to programmatically generate PDF, CSV, Excel, HTML, JSON and XML files.

Developer Experience

  • Page Designer has been enhanced to support multiple tabs in the Property Editor pane, making it more efficient to access the attributes of a region.
  • new code editor has been implemented throughout the development environment, resulting in a greatly improved code editing experience. The improved editor includes enhanced code completion, syntax highlighting and vastly improved accessibility.
  • The Embedded Code utility allows developers to inspect the SQL, PL/SQL and JavaScript contained within an APEX application. Having the ability to view the embedded code makes conducting tasks such as code reviews, security evaluations or application tuning, far more convenient. Code can be saved to the file system from the App Builder, or using the APEXExport utility.
  • Quick SQL has been enhanced to support the saving of a model, and the automatic population of a Primary Key using column default

Automations

Automations are a sequential set of PL/SQL actions, triggered by query results. They are used to monitor data and then perform the appropriate action (examples are auto-approving specific requests and sending email alerts). An automation can be triggered on Schedule or on Demand, by invoking the APEX_AUTOMATION package. Query results can be derived from:

  • Table or View, SQL Query or a PL/SQL function returning a SQL Query.
  • Local Database or REST Enabled SQL
  • REST Data Source (aka Web Source Modules)

REST Data Source Synchronization

APEX supports data synchronization from a REST Data Source (formerly known as Web Source Modules) to a local table. Synchronization can run either on Schedule or on Demand, by calling the APEX_REST_SOURCE_SYNC package. Developers don't need to build custom PL/SQL code in order to copy data from REST services to local tables; APEX provides this as a declarative option.

  • APEX can generate the local target table automatically, based on the attributes of the REST Data Source.
  • REST Source Data can be appended or merged to the local table. Replacing all local data is also supported.
  • APEX components using the REST Data Source can be configured to use the local table instead.
  • Technical details like HTTP request limits, commit intervals or delete methods for the Replace mode are configurable.

REST Data Source Connector Plug-Ins

The APEX Plug-In infrastructure has been extended to support Connector Plug-Ins for external REST APIs. This enables APEX to fully leverage REST API features like result pagination or server-side filtering, also for 3rd Party REST Services which are not ORDS or Oracle Fusion SaaS Services.

  • The Developer creates a Plug-In of the REST Data Source type.
  • The Plug-In code handles REST service-specific implementation details like the pagination style or how filters are passed to the REST API.
  • When APEX invokes a REST Data Source (e.g. to render a report), the engine will invoke the Plug-In code and pass all relevant context information.
  • The Plug-In code executes one or multiple HTTP requests and passes results back to the APEX engine.
  • APEX processes the REST response received from the Plug-In.

New Web Credential Types

APEX 20.2 introduces new URL Query String and HTTP Header types for Web Credentials. This allows developers to use the secure and encrypted credential storage also for REST Services which expect e.g. an API key as part of the URL. APEX makes sure that such sensitive parts are not written to debug or execution logs.

A web credential can now be protected by providing a URL pattern. APEX will only use the Web Credential for URLs starting with the given pattern; otherwise an error message will be raised. To change the URL pattern, the secret part of the Web Credential needs to be entered again.

JavaScript Library Upgrades

  • Oracle JET 9.1.0
  • jQuery 3.5.1
  • CKEditor 5
  • Monaco Editor 0.20.0

Tuesday, October 6, 2020

Database Backup & Restore Using Data Pump

 1. First we need to create Database Directory.

   CREATE DIRECTORY DB_BACKUP  AS 'D:\DATABASEB_BACKUP';
   GRANT READ, WRITE ON DIRECTORY DB_BACKUP TO HPP(Schema Name);

2. Provide Export/Import Privilege to Schema User:

   GRANT DATAPUMP_EXP_FULL_DATABASE TO HPP;
   GRANT DATAPUMP_IMP_FULL_DATABASE TO HPP;

3.Database Export Command For Specific Schema:

 EXPDP   HPP/HPP@ORCL schemas=HPP  DIRECTORY=DATABASE_BACKUP                    DUMPFILE=MRHS.dmp LOGFILE=full_exp.log   FULL=NO;

4.Database Import Command For Specific Schema :
    If user Exist Than First Drop User: DROP USER MRHS CASCADE;
   impdp  system/sys@ORCL  DIRECTORY = DATABASE_BACKUP  DUMPFILE = MRHS1.dmp             remap_schema=HPP:MRHS LOGFILE=full_IMPDp.log

5.Database Export Command For Multiple Schema:

 EXPDP   HPP/HPP@ORCL schemas=HPP,HPP_TRAN  DIRECTORY=DATABASE_BACKUP                    DUMPFILE=MRHS.dmp LOGFILE=full_exp.log  ;

6.Database Import Command For Multiple Schema :
    If user Exist Than First Drop User: DROP USER MRHS CASCADE;

    impdp  system/sys@ORCL  DIRECTORY = DB_BACKUP  DUMPFILE = hrms_07032022_v1.dmp             remap_schema=hrms:hrms,hrms_tran:hrms_tran LOGFILE=full_IMPDp.log

Saturday, August 29, 2020

Remove Success Message After Specific Time

 From Page properties go to==>Function and Global Variable Declaration

setTimeout(function() {

  $("#t_Alert_Success").remove();

}, 5000);


Wednesday, August 12, 2020

Auto Refresh Report After a Specified Interval In Oracle Apex

 



1.First we need to define Region Static ID. Example: Region Static ID is ATTENDANCE.

2.Go to page properties===>Execute When Page Loads 

//This will Auto-Refresh after 1 minutes
setInterval("jQuery('#ATTENDANCE').trigger('apexrefresh');", 100000);

Image File store outside of Oracle Database and show image into Apex Application

Directory Create : grant execute on utl_file to HRMS; CREATE OR REPLACE DIRECTORY STOCK_DIRECTORY AS 'C:\Program Files (x86)\Apache Sof...