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;
andexit;
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?