Itgenoda359 / itgenoda035 / itgenclr217: 500 Internal Server Error creating Quotation via Invantive Cloud with Exact Online

I am attempting to automate the creation of sales quotations (presupuestos) in Exact Online using Invantive Cloud. My goal is to build a module that accepts a JSON input containing customer and item data, and then creates a corresponding quotation within Exact Online.

Problem:

When executing the following SQL code within Invantive Cloud:

declare
  l_order_account_guid guid;
  l_quotation_id guid;
  l_company_name varchar2 := 'Lena Test Company';
  l_quotation_date date := to_date('2024-10-27', 'YYYY-MM-DD');
  l_description varchar2 := 'Test Quotation from Invantive Cloud';
begin
  use 8117@eol;

  select act.ID
  into l_order_account_guid
  from ExactOnlineREST..Accounts@eol act
  where act.Name = l_company_name;

  if l_order_account_guid is null then
    cloud_http.append_to_response_body_text('Invalid company name: ' || l_company_name || chr(10));
    raise_application_error(-20001, 'Invalid company name.');
  end if;

  insert into ExactOnlineREST..Quotations@eol (
    OrderAccount,
    QuotationDate,
    Description
  ) values (
    l_order_account_guid,
    l_quotation_date,
    l_description
  );

  select QuotationID
  into l_quotation_id
  from ExactOnlineREST..Quotations@eol
  where OrderAccount = l_order_account_guid
    and QuotationDate = l_quotation_date
    and Description = l_description;

  -- ... (rest of the code to create quotation lines) ...

  cloud_http.append_to_response_body_text('Sales quotation created successfully.' || chr(10));
end;

I encounter the following error messages:

An error occured - 6e23d1e6-e9e2-45a2-8304-4e67f9bd0636
itgenoda359:
The connection with website was unexpectedly and forcefully closed at 18/3/2025 10:38:17 for reasons such as insufficient privileges, a crash of website, system reboot, hard close of remote host or firewall action.
The data retrieval failed for all 3 tries during 54 seconds.
Please contact API support of Exact Online.
(https://start.exactonline.es/api/v1/8117/crm/Quotations).

itgenoda035:
The Exact Online server returned an internal error, which is typically an application error within Exact Online.
Please contact support of Exact Online with the collected native platform call data or raise a question on the Invantive forums with these call data.
(https://start.exactonline.es/api/v1/8117/crm/Quotations).

itgenclr217:
The remote server returned an error: (500) Internal Server Error.

Specific Sample

  • Exact Online Company Number: 8117
  • Tables Used: ExactOnlineREST..Quotations@eol, ExactOnlineREST..QuotationLines@eol, ExactOnlineREST..Accounts@eol, ExactOnlineREST..Items@eol
  • Goal: Create a sales quotation with two lines from a test company and test items.

Previous Attempts (No Avail)

  • I have verified the user permissions in Exact Online and confirmed that the Invantive Cloud user has the necessary access to create quotations.
  • I have attempted to use return; and exit; to handle errors within the Invantive Cloud SQL code, but encountered syntax errors.
  • I have verified that the correct columns are being used.

Could you please assist me in resolving this 500 Internal Server Error?

The itgenoda035 signals that Exact Online returned a HTTP 500 Internal Error.

Ultimately, Invantive Cloud projects it in this case on a HTTP 500 Internal Error of it’s own.

A possible cause is that the insert of quotations is not correctly encapsulated in a transaction. Exact Online requires a quotation to have at least one line. This can easily be reproduced in the Exact Online website: an error occurs when a quotation is saved without lines (“Ontbrekend: Regels” is Dutch for “Missing: Lines”):

A sample with Sales Orders, which has similar requirements, is given in Create an Exact Online Sales Order with Details through REST Calls. Please note use of begin transaction and commit.

Similar samples are:

This question was automatically closed after at least 1 week of inactivity after a possible solution was provided. The last answer given has been marked as a solution.

Please ask a new question via a separate topic if the problem occurs again. Please include a link to this topic in the new question by pasting its URL into the text.

Dit topic is 3 dagen na het laatste antwoord automatisch gesloten. Nieuwe antwoorden zijn niet meer toegestaan.