in

Resolve "Session State Protection Violation" Error in Oracle Apex

In Oracle Apex page, if you are having Display Only or Hidden page items or a page item whose Read-Only property is set to true. And you are updating the field values at runtime using the JavaScript, then on page submit you will face the "Session State Protection Violation" error.

The following are the examples to show you the solution for the "Session State Protection Violation" error in Oracle Apex.

Resolve Session State Protection Violation Error for Display Only and Read-Only items

We use Display Only and Read Only items so that the user can not edit the field values at runtime. But if you are updating the values programmatically using the JavaScript then rather than setting it from Oracle Apex as Display only or Read-only, it is better to set it using the JavaScript.

In the below example, it will set the page item P3_COMMISSION_PCT is read-only. Add this JavaScript code for your page items in your page properties Executes when page load section.

document.getElementById("P3_COMMISSION_PCT").readOnly = true;

Resolve Session State Protection Violation Error in Oracle Apex for Hidden Items

For the Hidden page items, set its Value Protected Property to No or Turn off the switch. As shown in the below image:

Hidden page item.

Check more on JavaScript for Input.

Related Tutorials:

Oracle Apex: Display Custom Error Messages from PL/SQL Process

Written by Vinish Kapoor

An Oracle Apex Consultant, Oracle ACE, and founder of foxinfotech.org and orclqa.com a question and answer forum for developers.

guest

4 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments