---
title: "Discussion on \"Saving Rich Text Content to the DB Via an Ajax Process in APEX\" | Hashnode"
description: "Discussion on \"Saving Rich Text Content to the DB Via an Ajax Process in APEX\". Find out how to auto-save the content of an Oracle APEX Rich Text Item to the database via a background Ajax PL/SQL Process."
url: "https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052"
---

[Feed](https://hashnode.com/feed) /

Discussion

# [Saving Rich Text Content to the DB Via an Ajax Process in APEX](https://blog.cloudnueva.com/saving-rte-content-via-ajax?utm_source=hashnode&utm_medium=feed)

Find out how to auto-save the content of an Oracle APEX Rich Text Item to the database via a background Ajax PL/SQL Process.

Mar 7, 2024 · 4 min read · blog.cloudnueva.com  
Read the article

-   [#orclapex](https://hashnode.com/tag/orclapex)
-   [#tinymce](https://hashnode.com/tag/tinymce)

## Written by

[Jon Dixon](https://hashnode.com/@orclapex)

@orclapex · San Diego, CA

  
[View profile](https://hashnode.com/@orclapex)

APEX, ORDS & the Oracle Database

I’m Jon Dixon, an Oracle APEX developer and consultant at Cloud Nueva. I write about APEX, ORDS, the Oracle Database, and how AI is changing the way we build software. This blog is where I share practical examples, lessons learned, and ideas from my work.

## Responses 2

Markdown supported · ⌘↵ to post

[Sasha Gomanuke](https://hashnode.com/@gomanuke)

[May 11, 2025](https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052/comment/68201dd91359b1472739e41b)

Hello, guys! Would You comment that mysterious part of code?

// Something bad happened. error: function(

In fact all application's SAVE\_NOTE errors goes in section success: function(

But what case will use error: function( ? I just guess that it's useless part of code...

BTW global error handling function doesnt catch pl-sql exceptions from ajax calls ((

[Jon Dixon](https://hashnode.com/@orclapex)

[May 11, 2025](https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052/comment/68201dd91359b1472739e41b#reply-6820edce1904f9ccbede1622)

Hi, The comment "Something bad happened." is just a comment to signify that some exception occurred in this JavaScript. PL/SQL errors should be trapped in the Ajax call and are displayed by this piece of code `} else {           // Stop the Interval so we don't keep trying to save after an error.           clearInterval(saveInterval);           // Show the error from the PL/SQL Ajax Process.           apex.message.clearErrors();           apex.message.showErrors([             {type: "error", location: ["page"], message: data.status_msg, unsafe: false}           ]);`

[Eric Sacramento](https://hashnode.com/@ericsacramento)

[Mar 7, 2024](https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052/comment/65ea18ee21576febad6790d2)

Hello Jon, I attempted to reproduce your code, but I believe I may have overlooked something. When I open the page for a new record and wait for 30 seconds, I encounter a 'no data found' error. However, aside from that issue, everything else is working as expected. Could you please confirm? Thanks, Eric

[Eric Sacramento](https://hashnode.com/@ericsacramento)

[Mar 8, 2024](https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052/comment/65ea18ee21576febad6790d2#reply-65eb0bbff23b1f9bbb2f1f00)

Exactly! The issue lies on line 13. It arises because the JavaScript runs every 30 seconds, even for new records. The problem specifically occurs for new records where P50\_NOTE\_ID is null. Since this item is null, I encounter a NO\_DATA\_FOUND exception. Thanks.

[Victorya Ebrahimi](https://hashnode.com/@Victorya)

[Mar 12, 2024](https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052/comment/65ea18ee21576febad6790d2#reply-65f055bec69fd8704320a566)

[Jon Dixon](https://hashnode.com/@orclapex) Hey John . I have the same issue as [Eric Sacramento](https://hashnode.com/@ericsacramento) mentioned. Would you please share the debug statements that you've added to verify the value of p\_note\_id ? I really don't know what to do and should I add some exceptions?

[Jon Dixon](https://hashnode.com/@orclapex)

[Mar 12, 2024](https://hashnode.com/posts/saving-rte-content-via-ajax/65e9b7026ccdef24ec711052/comment/65ea18ee21576febad6790d2#reply-65f0ce2c7a28e551eb98dc6f)

[Victorya Ebrahimi](https://hashnode.com/@Victorya), as Eric mentioned, I think you are getting this error because my code assumes a record was already created in cnnt\_notes before the background save kicks in. You could either create an initial record before the background save starts, or ignore the PL/SQL code in save\_note\_bg if p\_note\_id is NULL.
