Best practices

On our radar

  • If there are any advance queries, replace that by aggregate
  • Don't use foreach Loop in preparation
  • Don't use if conditions in preparation
  • i.e try to avoid if conditions in aggregate
  • Apply pagination on list page
  • Don't show more than 100 records on single page
  • Move JavaScript webblocks to bottom of page
  • Don't use preparation aggregates directly in screen actions
  • Before using them in screen actions refresh them

Suggested by  Suraj.

Created on 26 Mar 2018
Comments (3)

Changed the category to Documentation

"If there are any advance queries, replace that by aggregate" Is not best practice:


Aggregates and Advanced Queries


  • Use Aggregates: they’re optimized and database independent!
  • Avoid using indexes ([i]) when iterating a Query output
  • Minimize the number of Queries you need to execute
  • Avoid type casts in Aggregates

Advanced Queries

  • Use Advanced Queries only when absolutely necessary
  • Use Parameters instead of hard-coded values in the SQL Indent SQL code consistently
  • Use comments and inline comments in your SQL
  • Use Advanced Queries for bulk operations
  • Do not put business logic in the SQL
  • Use the EncodeSQL built-in function for Inline Parameters
  • Keep in mind that Advanced Queries are database specific

Changed the status to
On our radar

Hi Vijay Malviya,

Thank you so much for your idea! 

Let me share with you that we have plans to improve our Best Practices area, in the future. Your suggestions will be taken into consideration.

Keep the feedback coming :)