Best Practises
5 min
developer tools example entity order types within the order types entity are the entries for "maintenance", "malfunction" and "repair" listviews for example, when you open the order types list, look in the network tab for a call to "fetchallfilteredviapost" (for the api there is the controller "fetch") inside the sent payload as well as the response you can see how engine4 or our api receives and sends data editviews in the listviews you get records within the entities using an edit button (pencil icon) you can jump into the respective record and edit it also here queries are made in the background "fetchsingleobject" (for the api there is the controller "get") by looking at the payload, call parameters as well as responses you can get an idea of the data structure references / guid if you write data to engine4 (e g via the "saveall" controller) you will receive (if the returntype = dataid is set) a unique dataid back together with the entityid, the two fields form a unique assignment it is mandatory that this dataid is saved in the source object (e g order in erp or similar) once a dataid is available in the source system, future queries, for example, can be designed unambiguously and faster with the help of the dataid than if metadata is searched for first and the dataid is used afterwards currentness not all data changes regularly, therefore we recommend saving a datetime field in the source system with the last synchronization between engine4 and your source system this allows you to automatically check whether an api call is necessary or whether the last change is older than the synchronization date this saves resources and api calls loops do not use loops to perform single api queries if you want to fetch a list (fetch) of records from an entity or perform multiple updates/inserts (saveall), you can perform them as a single statement in doing so, you create the json in your interface and call the api call at the end this has the goal to reduce the api calls and to save resources in case of excessive usage, the api limitations are quickly reached and further calls are blocked