- edited description
New Live Template Suggestions
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).
- lsq (list from SOQL) → List<Account> accounts = [SELECT (cursor position) FROM Account];
- 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)
-
reporter -
repo owner - changed status to resolved
Thanks, Luke. These actually already exist as
sqv
andsqv1
. 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. -
repo owner You can see descriptions for all out-of-the-box live templates here:
http://www.illuminatedcloud.com/home/completion/livetemplates
-
reporter Ah very cool! Sorry, must have glazed over those. Dumb lol
-
reporter sqv and sqv1 make me happy every day, thanks Scott!
- Log in to comment