Access SQL Server Data from Javascript File Dynamically to Populate Fields

I have 2 custom checkbox fields I created on the quotes module which are saved to the database. Once the quote is turned into an invoice I want to be able to access the saved data for those 2 fields while I’m entering line items (using the line_items.js file). I am not even sure how I could get data from the SQL Server database from within a javascript file. The invoice and quote would be related but the custom fields I’m not using are not relate fields.

I even thought of possibly creating the same custom fields on the invoice edit layout but don’t want to use a workflow to populate as I need this data immediately (hence the reason I need to do it in the javascript file). I do not want to access from a php file.

I hope someone can provide some insight on how I can accomplish.

Thanks!

Versions:
SuiteCRM 7.10.7
PHP 7.2
SQL Server 2014
Windows Server 2012 R2

You could try accessing the API from Javascript.

There is also an Ajax solution with a custom action here:

https://community.sugarcrm.com/thread/24760

but I never tried this and it looks tricky…

Thank you. I found an add-on that may be able to help with what I need.