2

I'm having an issue where I've got a button that's action is to 'submit page' upon being clicked. The code then executes a PL SQL statement:

IF :REQUEST = 'btn_create_company' THEN
    INSERT INTO COMPANIES (company_name) VALUES(:COMPANY_NAME);

However, when the code comes to execute, whilst it is adding the entry to the database, I'm getting this error on the client which is preventing the page from redirecting after processing:

Error: SyntaxError: Unexpected end of JSON input

I don't understand why this is happening as I'm confident there's nothing wrong with the above statement.

4
  • If the row is being successfully inserted into COMPANIES, what makes you think this code is the cause of the problem? Commented Dec 4, 2017 at 7:50
  • Because this is the only code that's currently being executed when the button is clicked. Commented Dec 4, 2017 at 11:16
  • And it's also refusing to execute actions that come after this branch process. Commented Dec 4, 2017 at 13:15
  • Have a look at the debug log. Commented Dec 5, 2017 at 0:09

3 Answers 3

3

Ok, so I get this problem too, It's when I submit the page but instead of reload the whole page, I'm running a process and stay there.

The process itself works well, however I get the error message, just like you.

So I don't get the a solution, but found a workaround by adding this to the end of my process:

    apex_json.open_object;  
    apex_json.write('success', true);  
    apex_json.close_object; 
Sign up to request clarification or add additional context in comments.

Comments

0

You are missing the page number on :COMPANY_NAME. It should be something like :P1_COMPANY_NAME

1 Comment

You're making an assumption here - it's possible to create application items like COMPANY_NAME.
0

I was encountering a similar error when operating the last page in a chained dialog (aka "wizard") I had created.

The cause of my issue was that I had created a branch on the "After Submit" with the Behaviour/Type attribute set to "PL/SQL Procedure" and then had the code I wanted to be executed within the PL/SQL code attribute. When the "Finish" button was clicked, I was seeing the same error.

My resolution was to delete the branch and instead to use Create Process, with the Identification/Type set to "PL/SQL Code" and then placing the code I wanted to be executed within the "Source/PL/SQL Code" attribute.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.