Search This Blog

Thursday, April 20, 2023

Current version of data in database has changed since user initiated update process. Error occurred in Oracle Apex

Current version of data in database has changed since user initiated update process. 

Error occurred in Oracle Apex



This error can occur for many reasons, but one of the most common reasons is when the same row is updated by multiple parties at the same time. In my case, I get the error when updating a flag in my table. 

Then I realized that when I update the flag a trigger also fires and the same row inside the trigger gets updated again. So I faced a problem.

Monday, March 27, 2023

Negative Value Restriction in Oracle Apex Item

Goto Page Properties > Execute When Page Load > Copy-Pest Below Code with year page item.


$('#P51_NEW_2').autoNumeric('init',
  {
    allowDecimalPadding: false,
    currencySymbol: "$",
    decimalPlaces: 0,
    roundingMethod: "D",
    mDec: '0',
    minimumValue: "0"  -- (nagetive value not allowed)
});

Tuesday, March 14, 2023

How to develop Progress Bar in Oracle Apex (Bootstrap)

Bootstrap Progress Bar



1. 
--CSS INLINE

.progress-bar {
    display: -ms-flexbox;
    display: flex;
    -ms-flex-direction: column;
    flex-direction: column;
    -ms-flex-pack: center;
    justify-content: center;
    color: #fff;
    text-align: center;
    white-space: nowrap;
    background-color: #007bff;
    transition: width .6s ease;
}

.progress {
    display: -ms-flexbox;
    display: flex;
    height: 1rem;
    overflow: hidden;
    font-size: .75rem;
    background-color: #cfdae4;
    border-radius: .25rem;
}

--	COLUMN HTML EXPRESSION
2.
<span>
<div class="progress" style="height:20px;">
<div class="progress-bar" style="width:#Colum_Name#%">#Colum_Name#% </div>
</div>
</span>
 
 --COLUMN CALL BY FUNCTION
 3.
 create or replace function progress_bar(p_value in number)
 return varchar2 IS
 l_height number:=20;
 
 begin  
 return '<span>
<div class="progress" style="height:'||l_height||'px;">
 <div class="progress-bar" style="width:'||p_value||'%">'||p_value||'% 
 </div>
 </div>
 </span>';
 end ;
 
 
 -- CALL FUNCTION FROM REPORT QUERY
 4.
 
 SELECT progress_bar(Colum_Name) FROM table;
 
 

Monday, February 20, 2023

Database Value with Comma , Number Sign in URL by Link Error Solution

*** Column link data includes commas, number sign error 

*** Database Value with comma , number sign  in URL by Link type report column 

Solution : 

Just make the column link value like this  \#ColumnName#\  replace of  #ColumnName#

Saturday, February 4, 2023

Store Data into Browser local storage and sessionStorage

 Store Data into Browser local storage and sessionStorage. 

1.setItem(key, value) – Add key and value to sessionStorage or localStorage. 

localStorage.setItem("Order_id","12345"); 

or 

sessionStorage.setItem("first_name","Vikas"); 

 

2. getItem(key) – This is how you get items from sessionStorage or localStorage. 

 

localStorage.getItem("Order_id"); 

or 

sessionStorage.getItem("first_name"); 


3.removeItem(key) – remove the key with its value from sessionStorage or localStorage. 

 

localStorage.removeItem("Order_id"); 

or 

sessionStorage.removeItem("first_name"); 


4. clear() – Clear all from sessionStorage or localStorage. 

 

localStorage.clear(); 

or 

sessionStorage.clear(); 


 5. key(index) – Passed a number to retrieve the key of a sessionStorage or localStorage. 

 

localStorage.key(0); 

localStorage.key(1); 

or 

sessionStorage.key(0); 

sessionStorage.key(1); 


6. length – The number of stored items. 

 

localStorage.length; 

or 

sessionStorage.length; 

 

Merging New Json with Existing Json

Merging Json:

SELECT  json_mergepatch(Table.ExistingJsonColumn, '{"EXPANSE_DATA": {"MONTH" : { "JAN" : { "AMOUNT" : 2000}}}}') FROM Table

Rest Oracle Apex Developer User Password

  begin

 APEX_UTIL.RESET_PASSWORD (

   p_user_name      => 'User',

   p_new_password   => 'password',

   p_change_password_on_first_use=>false);

   end;

Get DDL of any Object in Oracle

SELECT DBMS_METADATA.get_ddl (<OBJECT_TYPE>, <OBJECT_NAME>, <SCHEMA_NAME>) FROM DUAL; --Must write everything in capital word


Stop Copy Pest From Your Application in Oracle Apex

1. Event > Page load.

2. Action > Execute JavaScript code.


$(document).ready(function () {
    //Disable cut copy paste
    $('body').bind('prevent cut copy paste', function (e) {
        e.preventDefault();
    });
   
    //Disable mouse right click
    $("body").on("contextmenu",function(e){
        return false;
    });
});


document.body.addEventListener('keydown', event => {
  if (event.ctrlKey && 'cvxspwuaz'.indexOf(event.key) !== -1) {
    event.preventDefault()
  }
})

Get a Hidden Item Value From Frontend in Oracle Apex

Get a Hidden Item Value From Frontend

Set Value inti Hidden Item From Frontend

1. Open an Apex page and Right click on the mouse then click on Inspect

2. Then click on Console.

3. Now put the javascript to get value or set value from the item. Exp:
apex.item("HiddinItemName").getValue();

apex.item("HiddinItemName").setValue();



you can see the hidden value.

Create a Form Using Python for Save Data into Excel like a Database

#Download Pyhton from here https://www.python.org/downloads/  #Download Python: #Click the “Download Python 3.x.x” button (the latest versio...