Team coding rules
Teach AISOQL how your team builds on Salesforce. Your rules are added to every generation, update and fix for everyone in your organization, and they stay private to you.
Good rules to start with
- Prefix every custom object, field and Apex class with
ACME_. - Use our
TriggerHandlerbase class: one trigger per object, no logic in the trigger. - Every new custom field needs a description and inline help text.
- Never hard-code record type IDs; look them up by developer name.
- Opportunity records must always have
Region__cset.
Short, specific rules work best. Up to 300 rules per organization.
Three ways to add rules
1. Type them in AISOQL
Open Organization → Team coding rules, add a rule and pick what it applies to (everything, Apex, Lightning web components, Flows, objects and fields, and so on). Owners and admins can edit; everyone on the team can see the list.
2. Keep a rules file in your GitHub repository
Add a file named aisoql-rules.md to your project, next to sfdx-project.json. Edit it in VS Code like any other file and commit it. On the Team coding rules page, pick the repository (it must be linked on the Organization page). AISOQL reads the file again at least every 10 minutes, or straight away with Sync now.
3. Import a file from your computer
Upload a .md or .txt file. You can add its rules to your list or replace rules imported before, and download your current rules as a file at any time.
Rules file format
One rule per line, starting with - . Headings set what the rules under them apply to. Anything else is ignored, so you can add notes.
# AISOQL team rules ## Everything - Prefix every custom object, field and Apex class with ACME_. ## Apex - Use the TriggerHandler base class: one trigger per object, no logic in the trigger. ## Objects and fields - Every new custom field needs a description and inline help text. ## Flows - Record-triggered flows must run after save unless they only update the same record.
Recognized headings: Everything, Apex, Lightning web components, Aura, Flows, Visualforce, Objects and fields, SOQL. Download an example file.
Learning from your failed deploys
When a sandbox validation or deploy of AISOQL-generated code fails, AI reviews the error. If it reveals something about your org, such as a required field or a validation rule the code has to satisfy, it adds a private rule for your team. You'll see these marked Learned from a failed deploy, with the error they came from. Edit or turn off any of them, or switch learning off.
Privacy
- Your team's rules are only used for members of your organization.
- Rules learned from your errors that name your own objects or fields stay in your private list. Only general Salesforce lessons with no names of yours, like "custom field names can be at most 40 characters", improve AISOQL for everyone.
Team coding rules are part of the Business and Team plans. Questions? Contact us.