Hi everyone , I have written a custom service based on client requirement. In the service, I am fetching data from generalJournalAccountEntry table, but its response time is too much that service times out when testing through Postman. This is the code, I am using for fetching data. How to get faster data
while select count(RecId), sum(ReportingCurrencyAmount) from generalJournalAccountEntry
group by generalJournalAccountEntry.MainAccount
join RecId from generalJournalEntry
where generalJournalEntry.RecId == generalJournalAccountEntry.GeneralJournalEntry
&& (generalJournalEntry.AccountingDate >= reqDoc.parmStartDate()
&& generalJournalEntry.AccountingDate <= reqDoc.parmEndDate())
{
MainAccount mainAcc = MainAccount::find(generalJournalAccountEntry.MainAccount);
f3GlExpensesRespDocument = new F3GlExpensesRespDocument();
f3GlExpensesRespDocument.parmNumberOfExpenses(generalJournalAccountEntry.RecId);
f3GlExpensesRespDocument.parmTotalExpenseAmount(expenseAmount);
f3GlExpensesRespDocument.parmGlCode(mainAcc.MainAccountId);
f3GlExpensesRespDocument.parmSuccess(true);
glExpensesList.addEnd(f3GlExpensesRespDocument);
}