Database Query
Collapse
X
-
Thank you very much. I figured it out a bit. I used XMLHttpRequest() to create what I want. In my example, everything is working now, but with an extraneous JSON file. Currently, a file is used for the GET request https://jsonplaceholder.typicode.com/users . Is it possible to get a similar JSON file, but within my site? For example, an array from the Accounts category?
-
If you are looking for a readymade solution without having to at least learn the basics and do some work yourself, perhaps you should not post your questions in the Developer forum but post them in this forum instead: https://forum.espocrm.com/forum/job-offers-requestsLast edited by telecastg; 04-24-2023, 08:34 PM. -
To fetch data from the database from a view class, you need to execute an Ajax call.
Check these threads to see some examples.
https://forum.espocrm.com/forum/developer-help/84099-dynamic-field-values-enum-multi-enum-etc?p=84110#post84110
This tutorial describes how to implement autocomplete for a given entity field (input field), filtered by the value of another field in the same entity (filter field) using a remote data source. For this example, we will be making an API call to a French service that lists address information. https://adresse.data.gouv.fr/api
Be mindful of javascript's asynchronous nature, make sure that you don't try to use the query results before the response is received from the Ajax call.
Hope this helps
it didn't help in any way, a lot of unnecessary information without solutions
Leave a comment:
-
To fetch data from the database from a view class, you need to execute an Ajax call.
Check these threads to see some examples.
https://forum.espocrm.com/forum/developer-help/84099-dynamic-field-values-enum-multi-enum-etc?p=84110#post84110
This tutorial describes how to implement autocomplete for a given entity field (input field), filtered by the value of another field in the same entity (filter field) using a remote data source. For this example, we will be making an API call to a French service that lists address information. https://adresse.data.gouv.fr/api
Be mindful of javascript's asynchronous nature, make sure that you don't try to use the query results before the response is received from the Ajax call.
Hope this helps
Leave a comment:
-
Database Query
I want to improve the capabilities of the wysiwyg editor. Namely, a modal window with the addition of a link. Below is a section of code.
self.createView('dialogInsertLink', 'views/wysiwyg/modals/insert-link', {
labels: {
insert: lang.link.insert,
openInNewWindow: lang.link.openInNewWindow,
url: lang.link.url,
textToDisplay: lang.link.textToDisplay,
itemslist:
[
{"name": "red", "first": true, "url": "#Red"},
{"name": "green", "link": true, "url": "#Green"},
{"name": "blue", "link": true, "url": "#Blue"}
]
,
Instead of an array in the "itemslist" variable, I need to make a query to the database. For example, get a list of counterparties from the "counterparties" section. How can I do this?
Tags: None
Leave a comment: