New Live Template Suggestions

Issue #1632 resolved
Luke Buthman created an issue

I know I am able to create Live Templates, but I think this request has larger appeal (plus I don’t even know if this is possible).

  1. lsq (list from SOQL) → List<Account> accounts = [SELECT (cursor position) FROM Account];
  2. ssq (single record from SOQL) → Account account = [SELECT Id FROM Account WHERE (cursor position) = LIMIT 1];

The thought process behind the WHERE clause cursor position was that it would be nearly impossible to know what field to filter on, but it would be convenient to have the boilerplate WHERE and = to be there already. Maybe the cursor could bring up a list of fields on the sObject and then tab could be pressed to enter the appropriate variable on the right side of the equals sign.

Comments (5)

  1. Scott Wells repo owner

    Thanks, Luke. These actually already exist as sqv and sqv1. The latter is a bit different from yours because it ensures that you don't get an unhandled exception if 0 or 2+ rows are returned.

  2. Log in to comment