Powered By Blogger

সোমবার, ৫ জানুয়ারি, ২০২৬

Row-level “Add” icon using a virtual column (APEX-safe)

1️⃣ Enable Insert in the Interactive Grid

IG → Attributes

  • Edit → Allowed

  • Add Row → Yes


2️⃣ Add a New Column (Icon column)

Column settings

  • Column Name: ADD_ROW

  • Type: Plain Text

  • Heading: (blank)

  • Escape Special Characters: No

  • Read Only: Yes

Column HTML Expression

<span class="fa fa-plus ig-add-row" title="Add Row" style="cursor:pointer;"></span>

(Uses Font APEX icons)


3️⃣ Add Dynamic Action (Click)

Dynamic Action

  • Event: Click

  • Selection Type: jQuery Selector

  • jQuery Selector:

.ig-add-row

4️⃣ True Action → Execute JavaScript Code

var grid = apex.region("emp_ig") .widget() .interactiveGrid("getViews", "grid"); // Add new row grid.model.insertNewRecord(); // Optional: focus first editable column var record = grid.getActiveRecord(); if (record) { grid.editRow(record); }

👉 Replace emp_ig with your IG Static ID.


✅ Result

  • “+” icon appears per row

  • Clicking it inserts a new row

  • No page submit

  • Works in APEX 20–24

  • Fully supported


রবিবার, ৭ ডিসেম্বর, ২০২৫

To find missing or gap ID numbers in an Oracle table

 To find missing or gap ID numbers in an Oracle table, you can use a query that generates a sequence of numbers and then compares it to the existing IDs in your table.


Here's a common approach using a CONNECT BY clause to generate a series of numbers:


SELECT

    (SELECT MIN(id_column) FROM your_table) + LEVEL - 1 AS missing_id

FROM

    DUAL

CONNECT BY

    LEVEL <= (SELECT MAX(id_column) FROM your_table) - (SELECT MIN(id_column) FROM your_table) + 1

MINUS

SELECT

    id_column

FROM

    your_table;

শনিবার, ১১ অক্টোবর, ২০২৫

Go to on page top Button (No Page Refresh)

 

✅ 

1️⃣ Use a <button> or <a> that doesn’t submit

Replace your existing button HTML with this:

<button type="button" id="backToTopBtn" title="Go to top"> ⬆️ </button>

🔹 The key is type="button" — this prevents APEX or the browser from treating it as a form submit button.

Or, alternatively, use a link:

<a href="javascript:void(0)" id="backToTopBtn" title="Go to top">⬆️</a>

2️⃣ Keep the CSS (same as before)

#backToTopBtn { display: none; position: fixed; bottom: 40px; right: 40px; z-index: 9999; font-size: 22px; border: none; outline: none; background-color: var(--ut-button-primary-bg, #4CAF50); color: white; cursor: pointer; padding: 12px 16px; border-radius: 50%; box-shadow: 0 2px 6px rgba(0, 0, 0, 0.3); transition: all 0.3s ease; } #backToTopBtn:hover { background-color: var(--ut-button-primary-bg-hover, #45a049); transform: scale(1.1); }

3️⃣ Add the JavaScript (no refresh, smooth scroll)

Put this in Page → Execute when Page Loads:

// Show or hide the button when scrolling window.addEventListener("scroll", function () { const btn = document.getElementById("backToTopBtn"); if (document.documentElement.scrollTop > 100 || document.body.scrollTop > 100) { btn.style.display = "block"; } else { btn.style.display = "none"; } }); // Scroll smoothly to top when clicked (no page refresh) document.getElementById("backToTopBtn").addEventListener("click", function (e) { e.preventDefault(); // stop any default button action $('html, body').animate({ scrollTop: 0 }, 'slow'); });

💡 Tip:

If you’re using Universal Theme, you can even make the button blend with APEX styles by using:

#backToTopBtn { background-color: var(--ut-button-primary-bg); color: var(--ut-button-primary-text); } #backToTopBtn:hover { background-color: var(--ut-button-primary-bg-hover); }

✅ Result:

  • Appears when user scrolls down

  • Smoothly scrolls to top

  • No refresh / no page reload / no URL change

  • Looks native to APEX theme

শনিবার, ২৬ এপ্রিল, ২০২৫

Finding IP Address in apex

 To Find IP Address of the User who login in Apex


This is the very import as a developer prospective, normally we are tracking who user’s login name, date and time for monitoring purpose.

But I saw so many scenarios, some users are sharing his credentials, which is totally wrong. So by using below code, we can track the Ip Address of The user. So, any issues we can caught him.

It’s very important for user for those report, which are very important as company prospective.  

It’s available under owa_util package and another query available in Sys_context.

Query

 SELECT OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR') IP_ADDESS_APP_USER FROM DUAL;

SELECT SYS_CONTEXT('USERENV', 'IP_ADDRESS', 15) IP_ADDESS_APP_USER FROM DUAL;


we can write the code Process > After Header


BEGIN

   INSERT INTO    xxxxcomany_apex_report_history (

                                         sa_username,

                                         sa_report_name,

                                         sa_page_id,

                                         sa_viewed_date,

                                         ip_address)

      (SELECT   

                :APP_USER,

                (SELECT   s.text

                   FROM   sify_procure_menu_ins s

                  WHERE   1 = 1 AND s.page_id = :APP_PAGE_ID)

                   text,

                :APP_PAGE_ID,

                SYSDATE,

    (SELECT OWA_UTIL.GET_CGI_ENV('REMOTE_ADDR') IP_ADDESS_APP_USER FROM DUAL) AS IP_ADDRESS


         FROM   DUAL);

END;


Row-level “Add” icon using a virtual column (APEX-safe)

1️⃣ Enable Insert in the Interactive Grid IG → Attributes Edit → Allowed Add Row → Yes 2️⃣ Add a New Column (Icon column) Column...