If for some reason, your start to see the following in thrown errors or in the event viewer, Application event log on the AOS, then you have an issue most likely with the QueryRun and Query Objects.:
The issue that your facing is the query that your creating. The query your creating, to make use with your QueryRun object is causing the AOS to hit a buffer limit. You can increase the buffer limit at the AOS. But most likely what you will need to do is force literals for the query your building in X++.
It’s simple to do, after your create an instance of the Query object simply do a:Query.literal(1); call.
This will ‘force the hand’ of the AOS to accept the buffer allocation requirement, and allow your advanced query to run. Therefore allowing your QueryRun operation to finish as desired.
Well that’s all for now. Ran into this, and thought it would be worth putting out here. If anyone has ran into this before, and wants to share feel free to leave a comment. Also if you have more details about literals and the use as described above, feel free to share that as well.Recently we were confronted with a case where we received the following SQL error:
In the SQL statement trace log (Administration -> Inquiries – Tab ‘Use’) you will find the stack trace that shows you which method caused the SQL error.
We have to add a forceliterals to the select statement in the relevant method.
Adding a forceliterals should avoid running into the SQL limitation of the 2100 parameters, because the statement is handled differently then.
Change code from
Activate forceliterals on the Query object
(C)JobsJob4 – line 29
More information on the RPC error is available here: