Technical guide · v4.4

Salesforce development standards

The normative framework Vantegrate uses to build solutions on Salesforce since 2009. Naming, data model, Flows, Apex, LWC, security, PMD and release management, all in a single technical document.

Designed to be consumed by human developers and by generative AI assistants (Agentforce, Cursor, Claude). Every rule includes concrete examples, canonical patterns and counter-examples.

11
Sections
16+
Conventions
75%+
Minimum coverage
v4.4
Version

Architecture of the guide

Hover to explore · click to jump to a section

Introduction

What is this document?

This Salesforce Development Standards Guide is Vantegrate's official normative framework for building solutions on the Salesforce platform. It defines the conventions, patterns and best practices that guarantee consistent, maintainable, high-quality code across every project.

The document sets clear rules for naming, code structure, the data model, automations, security and documentation. Each standard is backed by concrete examples, drawn from a real electronic-invoicing implementation on Salesforce, so it can be understood and applied immediately.

Who is it designed for?

Salesforce developers: both new members of the Vantegrate team and experienced developers will find here the mandatory conventions for writing code that integrates cleanly with the rest of the Vantegrate ecosystem.

Architects and tech leads: it provides a reference framework for code reviews, design decisions and the evaluation of technical quality.

Generative AI tools: this document is optimized to be consumed by AI assistants such as Agentforce, Cursor, Claude and other code-generation tools.

How to use this document

For human developers

  • Read sections 1 and 2 in full before writing any code.
  • Consult the specific section for the type of component you are building.
  • Use the checklists in section 11 before every commit and deploy.
  • Refer to Appendix A as a quick naming reference.

For AI tools

  • Include this document (or the relevant sections) in the prompt context.
  • Explicitly reference the naming conventions from section 2.
  • Require generated code to follow the patterns in sections 3-6.
  • Validate the output against the PMD rules in section 8.

Document design principles

PrincipleMeaning
Explicit over implicitEach rule includes concrete examples of correct and incorrect usage. No prior knowledge is assumed.
Optimized for AIThe conventions use consistent terminology and predictable structures that language models can interpret.
Practice-orientedEvery example comes from real cases, in particular the electronic-invoicing domain.
EvolvingIt is updated as new Salesforce capabilities and industry best practices emerge.

1Fundamental Principles

1.1 Fundamental Rule: English Only

Principle: all code, comments, names of variables, methods, classes, objects, fields and technical documentation must be in English.

Reason: English is the industry standard. It eases global collaboration, improves documentation and enables integration with analysis tools.

✓ Correct✗ Incorrect
AccountServiceServicioCuentas
isHighValueCustomeresClienteValioso
Invoice__cFactura__c
TotalAmount__cMontoTotal__c
// Calculate total revenue// Calcular ingresos

1.1.1 Distinction between Label and API Name

It is important to distinguish between Label (the value visible to the user) and API Name (the technical name used in code):

  • API Name: ALWAYS in English, using PascalCase. It is the technical identifier used in code, formulas, integrations and automations.
  • Label: MAY be in the end user's language. It is what the user sees in the Salesforce interface.
TypeLabel (User)API Name (Code)
FieldBilling periodBillingPeriod__c
FieldTax exemption codeTaxExemptionCode__c
FieldIs primaryIsPrimary__c
ObjectInvoice lineInvoiceLine__c
Record TypeInvoice - DraftInvoiceDraft

1.2 Test-Driven Development (TDD)

The TDD cycle is mandatory for all Apex development:

PhaseDescription
🔴 REDWrite a failing test (define the expected behavior).
🟢 GREENWrite the minimum code to make the test pass.
🔵 REFACTORImprove the code while keeping the tests green.

Coverage requirements

TypeRequired coverage
Minimum global coverage75%
Recommended coverage85%+
Critical classes (Services, Handlers)90%+
AssertionsEvery test MUST have meaningful assertions.

1.3 Quality and Performance

Golden rules (mandatory):

  • 🚫 NEVER run SOQL inside loops.
  • 🚫 NEVER run DML inside loops.
  • ALWAYS use bulk processing (design for 200+ records).
  • ALWAYS check Field Level Security (FLS).
  • ALWAYS check CRUD permissions before DML operations.
  • ALWAYS declare the sharing model (with sharing / without sharing).
  • 📋 Mandatory compliance with critical PMD rules.

1.4 Native-First Principle

Always prioritize native Salesforce solutions, in this order:

PriorityType of solutionExamples
1️⃣Third-party solutionsAppExchange or community components (unofficialSF)
2️⃣Declarative configurationValidation Rules, Formula Fields, Roll-up Summaries
3️⃣FlowsRecord-Triggered, Screen, Scheduled, Platform Event
4️⃣ApexWhen Flows cannot resolve the requirement
5️⃣External integrationsOnly when there is no native alternative
Before writing Apex code, check whether the functionality can be solved through declarative configuration or Flows. The easiest code to maintain is the code that does not exist.

2Universal Naming

This section defines the mandatory naming conventions for every Salesforce development component.

2.1 Case Styles

StyleDescriptionExample
PascalCaseFirst letter of each word capitalized, NO underscoresInvoiceService
camelCaseFirst word lowercase, the rest capitalizedaccountList
UPPER_SNAKE_CASEAll uppercase, separated by underscoresMAX_RECORDS
kebab-caseAll lowercase, separated by hyphensinvoice-form

2.1.1 Critical Rule: PascalCase with NO internal underscores

The Vantegrate convention requires PascalCase with no internal underscores for the API names of objects and fields.

✓ Correct✗ Incorrect
SecondaryContact__cSecondary_Contact__c
BillingPeriod__cBilling_Period__c
TaxExemptionCode__cTax_Exemption_Code__c
InvoiceLine__cInvoice_Line__c
PrimaryAccount__cPrimary_Account__c
Internal underscores hurt readability, create inconsistencies and can cause problems in AppExchange packages.

2.1.2 Using PascalCase

Apply it to names that represent entities, types or primary structures.

ComponentExample
Custom Objects API NameInvoice__c, InvoiceLine__c
Custom Fields API NameServiceDate__c, TotalAmount__c
Apex ClassesAccountService, InvoiceController
Apex TriggersAccountTrigger, InvoiceTrigger
Test ClassesAccountServiceTest, InvoiceControllerTest
Flow API NamesInvoice_AfterInsert_SendToAfip
Permission SetsInvoicing_FullAccess, Billing_ReadOnly
Validation RulesInvoice_Amount_Required
Record Types (DeveloperName)InvoiceDraft, InvoicePosted

2.1.3 Using camelCase

Apply it to variables, methods, properties and internal elements.

ComponentExample
Apex MethodscalculateTotal(), processInvoices()
Apex VariablesinvoiceList, isValid, totalAmount
LWC Component NamesinvoiceForm, customerOnboarding
LWC PropertiesisLoading, recordId, errorMessage
Flow VariablesvarB_IsValid, varT_CustomerName

2.1.4 Using UPPER_SNAKE_CASE

Apply it to constants and immutable values.

ComponentExample
Apex ConstantsMAX_RECORDS, DEFAULT_PAGE_SIZE
Apex Static Final VariablesAPI_VERSION, BATCH_SIZE
LWC ConstantsMAX_FILE_SIZE, SUPPORTED_FORMATS

2.1.5 Using kebab-case

Apply it in HTML references and web attributes.

ComponentExample
LWC Component Tags in HTML<c-invoice-form>, <c-user-profile>
CSS Class Names.container-main, .button-primary
Data Attributesdata-record-id, data-field-name

2.2 Summary table: Case style by component

ComponentCase styleExample
Custom Object API NamePascalCaseInvoice__c
Custom Field API NamePascalCaseTotalAmount__c
Apex ClassPascalCaseInvoiceService
Apex MethodcamelCasecalculateTotal()
Apex VariablecamelCaseinvoiceList
Apex ConstantUPPER_SNAKE_CASEMAX_RECORDS
Apex TriggerPascalCaseInvoiceTrigger
Test ClassPascalCaseInvoiceServiceTest
Test MethodcamelCasetestCalculate_Valid_Success
LWC Component NamecamelCaseinvoiceForm
LWC in HTML Templatekebab-case<c-invoice-form>
Flow API NamePascalCaseInvoice_AfterInsert_Send
Flow VariablecamelCasevarB_IsValid
Permission SetPascalCaseInvoicing_FullAccess
Record TypePascalCaseInvoiceDraft
CSS Classkebab-case.btn-primary

2.3 Custom Objects

Case style: PascalCase. API Name format: [ObjectName]__c.

Object typePrefixAPI Name exampleLabel example
Business ObjectInvoice__cInvoice
Junction ObjectAccountContact__cAccount Contact
Setting/ConfigInvoiceSettings__cInvoice Settings
Log/HistoryIntegrationLog__cIntegration Log
Managed Packagevtg__vtg__ProductCatalog__cProduct Catalog

Mandatory rules

  • USE PascalCase for the API Name.
  • USE the singular (Invoice__c, NOT Invoices__c).
  • USE descriptive English names.
  • Junction Objects: concatenate the names in alphabetical order.
  • Do NOT use abbreviations except for standard ones (Id, URL, API).

2.4 Custom Fields

Case style: PascalCase with no internal underscores. API Name format: [FieldName]__c.

TypeConvention✓ Correct✗ Incorrect
Lookup (single)Object nameAccount__cAccount_Lookup__c
Lookup (with role)[Role][Object]BillingAccount__cBilling_Account__c
External ID[System]ExternalIdComfiarExternalId__cComfiar_Ext_Id__c
CheckboxIs / Has / CanIsActive__cIs_Active__c
Date[Desc]DateInvoiceDate__cInvoice_Date__c
DateTime[Desc]DateTimeProcessedDateTime__cProcessed_Date_Time__c
CurrencyDescriptiveTotalAmount__cTotal_Amount__c
TextDescriptiveTaxExemptionCode__cTax_Exemption_Code__c

2.5 Relationship Fields (Lookup and Master-Detail)

Relationship fields deserve special attention because they define how users "read" the data model.

2.5.1 Single relationship to an object

When an object has ONE relationship to another object, the API Name is simply the name of the target object:

Invoice__c
apex
1// Invoice__c has a lookup to Account
2Field API Name: Account__c
3Field Label: Account

2.5.2 Multiple relationships to the same object

When an object has MULTIPLE relationships to the same object, use the pattern: [Role][ObjectName]__c.

Invoice__c
apex
1// Invoice__c has two lookups to Contact
2PrimaryContact__c → Label: Primary Contact
3BillingContact__c → Label: Billing Contact
✓ Correct✗ Incorrect
PrimaryContact__cPrimary_Contact__c
SecondaryContact__cContact2__c
BillingAccount__cBilling_Account__c
ApproverUser__cApprover_User__c

2.5.3 Common examples of role-based fields

ScenarioAPI NameSuggested label
Billing accountBillingAccount__cBilling Account
Shipping accountShippingAccount__cShipping Account
Primary contactPrimaryContact__cPrimary Contact
Approver userApproverUser__cApprover
Parent projectParentProject__cParent Project
Original invoiceOriginalInvoice__cOriginal Invoice

2.6 Junction Objects

A Junction Object implements a many-to-many relationship between two objects.

2.6.1 Naming

Fundamental rule: use a business name, NOT a technical one.

✓ Correct✗ Incorrect
Application__cCandidateJobJunction__c
Enrollment__cStudentCourseJunction__c
Subscription__cUserServiceJunction__c
Assignment__cEmployeeProjectJunction__c
Membership__cContactGroupJunction__c

2.6.2 Structure of a Junction Object

Application__c
apex
1Object: Application__c
2Label: Application | Plural Label: Applications
3
4Master-Detail fields:
5 - Candidate__c (MD → Candidate__c)
6 - JobPosition__c (MD → JobPosition__c)
7
8Additional fields:
9 - ApplicationDate__c (Date)
10 - Status__c (Picklist: Pending, Approved, Rejected)

2.6.3 Primary Master-Detail relationship

The first Master-Detail field created becomes the primary relationship. This determines ownership inheritance, cascade delete and Roll-up Summary availability.

Choose as primary the object with the greater business importance, or the one that will control the cascade delete.

2.7 Record Types

DeveloperName: PascalCase, with no __c suffix.
Pattern: [Object][Segment] or [Object][Process].

ObjectDeveloperNameLabel
AccountAccountB2BAccount - B2B
AccountAccountB2CAccount - B2C
Invoice__cInvoiceDraftInvoice - Draft
Invoice__cInvoicePostedInvoice - Posted
CaseCaseSupportCase - Support
CaseCaseBillingCase - Billing

2.8 Page Layouts

Pattern: [Object] Layout - [Variant].

✓ Correct✗ Incorrect
Invoice Layout - DraftInvoiceDraft
Invoice Layout - PostedPosted Invoice Layout
Account Layout - PartnerPartner Account Layout
Account Layout - StandardAccount Layout

2.9 Apex Classes

Case style: PascalCase with a descriptive suffix based on the role.

TypeSuffixExamplePurpose
ServiceServiceInvoiceServiceBusiness logic
SelectorSelectorInvoiceSelectorSOQL queries
Domain(plural)InvoicesObject behavior
Trigger HandlerTriggerHandlerInvoiceTriggerHandlerTrigger logic
ControllerControllerInvoiceControllerLWC/Aura controller
BatchBatchInvoiceGenerationBatchBatch processing
SchedulableSchedulerDailyInvoiceSchedulerScheduled jobs
QueueableQueueableInvoiceSendQueueableAsync processing
TestTestInvoiceServiceTestUnit tests
Test Data FactoryTestDataFactoryTestDataFactoryTest data creation
UtilityUtilTaxCalculationUtilUtility methods
ExceptionExceptionValidationExceptionCustom exceptions
InvocableInvocableSendToAfipInvocableActions for Flow
WrapperWrapperInvoiceWrapperData transfer objects

2.10 Apex Methods and Variables

ElementCase Style✓ Correct✗ Incorrect
MethodscamelCasecalculateTotal()CalculateTotal()
Local variablescamelCaseinvoiceListInvoiceList
ParameterscamelCaseinvoiceIdInvoiceId
ConstantsUPPER_SNAKEMAX_RECORDSmaxRecords
Boolean varscamelCaseisValidIsValid
CollectionscamelCaseinvoicesInvoices

2.11 Triggers

Case style: PascalCase. Format: [ObjectName]Trigger.

Critical rule: one trigger per object. All logic must be delegated to the TriggerHandler.
✓ Correct✗ Incorrect
InvoiceTriggerinvoiceTrigger
InvoiceLineTriggerinvoice_line_trigger

2.12 Test Classes and Methods

Test Class: PascalCase → [ClassBeingTested]Test.
Test Method: camelCase → test[Method]_[Scenario]_[Result].

ExampleDescription
InvoiceServiceTestTest class (PascalCase)
testCalculateTotal_ValidData_ReturnsSumTest method (camelCase)
testValidateInvoice_MissingCAE_ThrowsExceptionTest method (camelCase)

2.13 Validation Rules

Format: [Object]_[Field/Condition]_[RuleType].

✓ Correct✗ Incorrect
Invoice_TotalAmount_Requiredinvoice_total_required
Invoice_CAE_ValidFormatinvoiceCAEValidation
InvoiceLine_Quantity_PositiveVR_001

2.14 Permission Sets

Permission Set: [Feature/Object]_[AccessLevel].
Permission Set Group: [Role]_Permissions.

TypePatternExample
Full Access PS[Object]_FullAccessInvoicing_FullAccess
Read Only PS[Object]_ReadOnlyInvoicing_ReadOnly
Feature PS[Feature]_AccessReportBuilder_Access
Integration PS[System]_IntegrationComfiar_Integration
PS Group[Role]_PermissionsBillingManager_Permissions

2.15 Flows

API Name: PascalCase with underscores as separators.
Variables: camelCase with a type prefix.

Flow typePatternExample
Record-Triggered (Before)[Obj]_Before[Event]_[Action]Invoice_BeforeInsert_Validate
Record-Triggered (After)[Obj]_After[Event]_[Action]Invoice_AfterInsert_SendToAfip
Screen Flow[Process]_ScreenFlowInvoiceCreation_ScreenFlow
Autolaunched[Process]_AutolaunchedInvoiceGeneration_Autolaunched
SubFlowSubFlow_[Function]SubFlow_CalculateTaxes
Scheduled[Process]_Scheduled_[Freq]InvoiceRetry_Scheduled_Hourly
Platform Event[EventName]_HandlerInvoiceApproved_Handler

2.16 Reports and Dashboards

Report and Dashboard names are visible to end users, so clarity and organization come first.

2.16.1 Report naming

Case style: Title Case with spaces (readable for users).
Format: [Area] – [Descriptive Name] ([Period]).

✓ Correct✗ Incorrect
Sales – Pipeline by Stage (Monthly)SalesPipelineMonthly
Billing – Invoices Pending CAEInvoicesPendingCAE
Support – Open Cases by PriorityOpenCasesByPriority
HR – Onboarding Q4 2025HR_Onboarding_Report

2.16.2 Dashboard naming

Format: [Area] – Dashboard [Purpose].

ExampleDescription
Sales – Executive DashboardExecutive view of sales metrics
Billing – Operations DashboardDaily billing metrics
Support – SLA DashboardService-level tracking
Marketing – Q4 Campaigns DashboardCampaign performance

2.16.3 Folder naming

Format: [Area/Department] – [Topic].

Folder exampleContents
Sales – Pipeline ReportsSales pipeline reports
Billing – AFIPAFIP/COMFIAR integration reports
Finance – CollectionsCollections and aging reports
Executive – KPIsDashboards for leadership
Keeping folder, report and dashboard names consistent makes navigation easier. Using the same area prefix groups content logically.

3Data Model

3.1 Standard Integration Fields

For objects that take part in integrations with external systems (such as COMFIAR, ERPs, etc.):

FieldAPI NameTypePurpose
Integration StatusIntegrationStatus__cPicklistSync state
Last Sync DateTimeLastSyncDateTime__cDateTimeLast successful sync
Sync Error MessageSyncErrorMessage__cLong TextError detail
Retry CountSyncRetryCount__cNumber(3,0)Sync attempts

4Flow Standards

Flows account for roughly 60% of automation development on Salesforce.

4.1 Flow Variables

Case style: camelCase with a type prefix (varB_, varT_, etc.).

TypePrefixExampleUse
BooleanvarB_varB_IsValidInvoiceFlags, decisions
CurrencyvarC_varC_TotalAmountMonetary values
DatevarD_varD_InvoiceDateDates without time
DateTimevarDT_varDT_ProcessedAtTimestamps
NumbervarN_varN_LineCountCounters
TextvarT_varT_CAENumberStrings
RecordvarR_varR_CurrentInvoiceSingle record
CollectionvarCol_varCol_InvoiceLinesList of records

4.2 Flow Elements

Decisions

Case style: Sentence case (question in English).

✓ Correct✗ Incorrect
Is Valid Invoice?Invoice_Check
Has Valid CAE?CAE_VALIDATION
Exceeds Credit Limit?verificarLimite

Assignments

PrefixUseExample
SETAssign a valueSET Invoice Status
CALCCalculate a valueCALC Total With Taxes
INITInitialize collectionsINIT Lines Collection
ADDAdd to a collectionADD to Update Collection
LOGPrepare logging dataLOG Error Details

Data Elements

✓ Correct✗ Incorrect
Get Invoice RecordsDATA_RETRIEVAL
Create Invoice LinecreateLine
Update Invoice StatusUpdate1
Delete Draft Invoiceseliminar_borradores

4.3 Error Handling

Mandatory: add a Fault Path to every critical element:
  • All Get/Create/Update/Delete Records elements.
  • HTTP Callouts / External Services.
  • Calls to SubFlows.
  • Invocable Actions.

4.4 Flow Performance

Performance checklist:

  • Use specific filters in Get Records elements.
  • Limit the records returned (use LIMIT).
  • Select only the fields you need.
  • ONE Get Records per object (consolidate).
  • NEVER DML inside loops: use collections.
  • SubFlows for reusable logic.
  • Maximum 50 elements per Flow.
  • Fault paths on critical elements.

5Apex Development and TDD

5.1 Apex Class Structure

InvoiceService.cls
apex
1/**
2 * @description Service class for Invoice-related business logic
3 * @author Vantegrate Development Team
4 * @date 2025-12-01
5 */
6public with sharing class InvoiceService { // PascalCase
7
8 // UPPER_SNAKE_CASE for constants
9 private static final Decimal IVA_RATE = 0.21;
10 private static final Integer MAX_RETRY_COUNT = 3;
11
12 // camelCase for methods
13 public static Decimal calculateTotalWithTax(List<InvoiceLine__c> lines) {
14 // camelCase for variables
15 Decimal subtotal = 0;
16 Decimal taxAmount = 0;
17
18 for (InvoiceLine__c line : lines) {
19 subtotal += line.Amount__c;
20 }
21
22 taxAmount = subtotal * IVA_RATE;
23 return subtotal + taxAmount;
24 }
25}

5.2 Trigger Handler Pattern

The trigger must be minimal and delegate all logic to the handler:

InvoiceTrigger.trigger
apex
1// Trigger — PascalCase: [Object]Trigger
2trigger InvoiceTrigger on Invoice__c (before insert, after insert) {
3 new InvoiceTriggerHandler().run();
4}
InvoiceTriggerHandler.cls
apex
1// Handler — PascalCase: [Object]TriggerHandler
2public class InvoiceTriggerHandler extends TriggerHandler {
3
4 public override void beforeInsert() {
5 InvoiceService.validateInvoices((List<Invoice__c>) Trigger.new);
6 }
7
8 public override void afterInsert() {
9 InvoiceService.sendToComfiar((List<Invoice__c>) Trigger.new);
10 }
11}
Rule: one trigger per object. All business logic must live in Service classes, not in the trigger or the handler.

6Lightning Web Components (LWC)

6.1 Component Naming

ElementCase StyleJS exampleHTML example
Component NamecamelCaseinvoiceForm<c-invoice-form>
JS PropertiescamelCaseisLoading
JS MethodscamelCasehandleSave()
ConstantsUPPER_SNAKEMAX_LINES
Event Nameslowercase'save'onsave
CSS Classeskebab-case.btn-primary
Data Attributeskebab-casedata-line-id

6.2 LWC Best Practices

  • Use @api for public properties exposed to parents.
  • Use @track only when necessary (reactive objects/arrays).
  • Prefer getter methods over @track for computed values.
  • Handle errors in wire methods.
  • Use ShowToastEvent for user feedback.
  • Avoid querySelector: use data-id and template refs.
  • Implement loading states for async operations.
  • Use UPPER_SNAKE_CASE constants for magic values.

7Security and Permissions

7.1 CRUD and FLS

ALWAYS check permissions before data operations.

In the example below, as user applies the checks automatically and you only need to catch the exception:

Insert with 'as user'
apex
1Account myAcc = new Account(
2 Name = 'Vantegrate Upgrade',
3 AnnualRevenue = 500000 // Assume this field is read-only
4);
5try {
6 // Automatically validates CRUD, FLS and Sharing Rules
7 insert as user myAcc;
8} catch (DmlException e) {
9 // Robust handling of security errors
10 for (Integer i = 0; i < e.getNumDml(); i++) {
11 if (e.getDmlType(i) == StatusCode.INSUFFICIENT_ACCESS_OR_READONLY) {
12 System.debug('Error: the user does not have permission');
13 } else {
14 System.debug('Other DML error: ' + e.getDmlMessage(i));
15 }
16 }
17}

In the example below, using WITH USER_MODE at the end of the SOQL query runs the checks automatically and you only need to catch the exception:

SOQL with WITH USER_MODE
apex
1try {
2 // The query fails if the user lacks access to 'Phone' or 'Industry'
3 List<Account> accs = [
4 SELECT Id, Name, Phone
5 FROM Account
6 WHERE Industry = 'Technology'
7 WITH USER_MODE
8 ];
9 System.debug('Records retrieved respecting security: ' + accs.size());
10} catch (QueryException e) {
11 // The message indicates which field or permission is missing
12 System.debug('SOQL permission error: ' + e.getMessage());
13}

7.2 Sharing Model

Rule: ALWAYS declare sharing in Apex classes.
KeywordUse
with sharingDEFAULT: respects sharing rules. Use for normal business logic.
without sharingIgnores sharing rules. Only for system operations (batch, integrations).
inherited sharingInherits from the caller. Use for reusable utility classes.

7.3 Security Checklist

  • Declare the sharing model in every class.
  • Check CRUD before DML operations.
  • Check FLS before accessing sensitive fields.
  • Use WITH USER_MODE in queries.
  • Do not hardcode IDs.
  • Sanitize user inputs.
  • Use variable binding in SOQL (prevent injection).
  • Avoid sensitive information in debug logs.

8PMD Rules

8.1 Critical Rules (Block Deploy)

RuleDescription
ApexUnitTestClassShouldHaveAssertsTests MUST have assertions.
AvoidLogicInTriggerTriggers MUST delegate to handlers.
AvoidDmlStatementsInLoopsNEVER DML in loops.
AvoidSoqlInLoopsNEVER SOQL in loops.
ApexCRUDViolationCheck CRUD before DML.
ApexSharingViolationsDeclare sharing in classes.
ApexSOQLInjectionPrevent SOQL injection.
AvoidHardcodingIdNo hardcoded IDs.

8.2 Best-Practice Rules

RuleDescription
DebugsShouldUseLoggingLevelDebug with a level: System.debug(LoggingLevel.INFO, msg).
ApexAssertionsShouldIncludeMessageAssertions with a descriptive message.
MethodNamingConventionsMethods in camelCase.
ClassNamingConventionsClasses in PascalCase.
FieldNamingConventionsVariables in camelCase.
OneDeclarationPerLineOne declaration per line.
AvoidGlobalModifierAvoid global (except for web services).

9Versioning and Release Management

9.1 Semantic Versioning

Format: MAJOR.MINOR.PATCH.

ComponentIncrement whenExample
MAJOR (X.0.0)Breaking changes, major redesign2.0.0 → New data model
MINOR (x.Y.0)New backward-compatible functionality2.1.0 → New integration
PATCH (x.y.Z)Bug fixes, minor improvements2.1.1 → Fix validation rule

9.2 Release Notes

Every release must document:

  • Version number and date.
  • New features.
  • Changes to existing functionality.
  • Bug fixes.
  • Breaking changes (if any).
  • Migration steps (if any).
  • Updated dependencies.

10Documentation

10.1 ApexDoc for Classes

InvoiceService.cls
apex
1/**
2 * @description Service for invoice lifecycle management and AFIP integration
3 * @author Vantegrate Development Team
4 * @date 2025-12-01
5 * @version 2.0
6 */
7public with sharing class InvoiceService {
8
9 /**
10 * @description Sends invoices to COMFIAR for AFIP authorization
11 * @param invoices List of invoices to process
12 * @return ProcessingResult Results including CAE numbers
13 * @throws IntegrationException When COMFIAR is unavailable
14 * @example
15 * List<Invoice__c> invoices = [SELECT Id FROM Invoice__c];
16 * InvoiceService.sendToComfiar(invoices);
17 */
18 public static ProcessingResult sendToComfiar(List<Invoice__c> invoices) {
19 // Implementation
20 }
21}

10.2 Flow Documentation

Every Flow must include in its Description:

Flow Description
apex
1FLOW NAME: Invoice Authorization Automation
2
3PURPOSE:
4Sends new invoices to COMFIAR for AFIP authorization
5and updates CAE information upon response.
6
7TRIGGER:
8Record-Triggered Flow on Invoice__c (After Insert)
9
10INPUT REQUIREMENTS:
11- Invoice with Customer, InvoiceDate, and at least one Line
12
13ERROR HANDLING:
14- Validation errors: Set ProcessingStatus__c = 'Error'
15- COMFIAR errors: Log to IntegrationLog__c, alert admin
16
17VERSION: 2.0
18LAST MODIFIED: 2025-12-01
19AUTHOR: Vantegrate Development Team

11Checklists and Templates

11.1 Pre-Deployment Checklist

  • Every class has coverage ≥ 75%.
  • Every test has meaningful assertions.
  • PMD reports no critical violations.
  • ApexDoc complete on public classes.
  • Flows have fault paths on critical elements.
  • No SOQL/DML in loops.
  • Bulk testing completed (200+ records).
  • Names follow the standard conventions.
  • Security Review: CRUD/FLS verified.
  • Release notes documented.

11.2 Code Review Checklist

  • Code in English (variables, methods, comments).
  • Correct naming per the standard.
  • Triggers delegate to Handlers.
  • Classes declare the sharing model.
  • No hardcoded IDs.
  • Error handling implemented.
  • Appropriate logging with LoggingLevel.
  • Tests cover positive and negative scenarios.
  • Bulk processing implemented.

11.3 New Custom Object Checklist

  • API Name in PascalCase and singular.
  • Label and Plural Label defined.
  • Description completed.
  • ExternalId__c field created.
  • IsActive__c field created.
  • SourceSystem__c field created.
  • LastProcessedDateTime__c field created.
  • ProcessingStatus__c field created.
  • Sharing model configured.
  • Permission Sets updated.
  • Page Layouts configured.

AAppendix A: Quick Naming Reference Table

ElementCase StylePatternExample
Custom ObjectPascalCase[Name]__cInvoice__c
Custom FieldPascalCase[Name]__cTotalAmount__c
Apex ClassPascalCase[Name][Suffix]InvoiceService
Apex MethodcamelCase[verb][Object]calculateTotal
Apex VariablecamelCase[name]invoiceList
Apex ConstantUPPER_SNAKE[NAME]MAX_RECORDS
Test ClassPascalCase[Class]TestInvoiceServiceTest
Test MethodcamelCasetest[M]_[S]_[R]testCalc_Valid_Ok
TriggerPascalCase[Object]TriggerInvoiceTrigger
LWC ComponentcamelCase[descriptive]invoiceForm
LWC in HTMLkebab-case<c-[name]><c-invoice-form>
LWC PropertycamelCase[name]isLoading
LWC ConstantUPPER_SNAKE[NAME]MAX_FILE_SIZE
Flow API NamePascalCase[Obj]_[Action]Invoice_SendToAfip
Flow VariablecamelCasevar[T]_[Name]varB_IsValid
Flow DecisionSentence[Question]?Is Valid?
Permission SetPascalCase[Obj]_[Access]Invoicing_Admin
Validation RulePascalCase[O]_[F]_[Rule]Invoice_CAE_Required
Record TypePascalCase[Obj][Segment]InvoiceDraft
Page LayoutMixed[Obj] Layout - [V]Invoice Layout - Draft
CSS Classkebab-case.[name].btn-primary

End of document

Vantegrate Standards Guide · Version 4.4

Back to top
Frequently asked questions

Frequently asked questions

What Salesforce developers and technical leads ask most before adopting these standards.

What are Vantegrate's Salesforce development standards?

They are the official normative framework Vantegrate has used to build solutions on Salesforce since 2009: naming, data model, Flows, Apex, LWC, security, PMD rules, release management and documentation, all in version 4.4 of a single technical guide.

What naming conventions does the guide enforce?

API names use PascalCase with no internal underscores (Invoice__c, TotalAmount__c), methods and variables use camelCase, constants use UPPER_SNAKE_CASE, and HTML/CSS references use kebab-case. Code, comments and technical names are always in English.

Can AI assistants use this guide to generate Salesforce code?

Yes. The document is optimized for AI tools such as Agentforce, Cursor and Claude. Include the relevant sections in the prompt context, reference the naming conventions, and validate the output against the critical PMD rules in section 8.

What is the minimum Apex test coverage Vantegrate requires?

The minimum global coverage is 75%, with 85%+ recommended and 90%+ for critical classes such as Services and Handlers. Every test must include meaningful assertions, never just line coverage.

Manifesto

Why this guide exists

Because a poorly written trigger can stall a deploy of 10,000 records.

Because a SOQL inside a loop can topple a transaction that took weeks to design.

Because a field without Field Level Security can expose the data of a customer who trusted you.

Because good code is the kind no one notices: it keeps working while the business grows, the Org expands and the team changes.

This guide does not exist to limit you. It exists so the code you write today keeps making someone happy three years from now, even if that person never knows it was your hand that left it that way.

The Vantegrate developer's oath

For the platform, for the team, for the client.

  • 01I promise to write code that others can read.
  • 02I promise not to duplicate a trigger where one already exists.
  • 03I promise to respect the limits of the platform over my own elegance.
  • 04I promise to check permissions before querying the data.
  • 05I promise to leave the repo better than I found it.
  • 06I promise my tests will say something, not just cover lines.
  • 07I promise to remember that the easiest code to maintain is the code I never wrote.

Signed by every Vantegrate developer

Guide v4.4

Equipo Vantegrate en evento Salesforce Buenos Aires

Más de 35 integraciones directas

SalesforceMercado PagoOpenpayPaywayOracleServiceNowSlackSAPStripeFiservSalesforce Marketing CloudMicrosoft Dynamics 365HubSpotWhatsApp BusinessSalesforceMercado PagoOpenpayPaywayOracleServiceNowSlackSAPStripeFiservSalesforce Marketing CloudMicrosoft Dynamics 365HubSpotWhatsApp Business
Developers Salesforce

Are you a Salesforce developer?

We work with certified professionals who build on these standards every day. If you share how we think about code, we want to meet you.

Join the team
Empresas

Do you have an Org that needs AI?

We apply these standards to every implementation. In the Salesforce ecosystem since 2009, with applications that passed the Security Review.

Let's talk about your Org
Equipo Vantegrate en oficina al atardecer — empresa de agentes de IA
Equipo Vantegrate en pasillo de oficina — cultura de trabajo remoto
Desarrolladores Vantegrate trabajando con laptops — desarrollo de IA empresarial
Equipo Vantegrate trabajando junto al puerto — empresa de inteligencia artificial
Equipo Vantegrate en sala de reuniones — estrategia de automatización con IA
Equipo Vantegrate trabajando con vista al río — agentes de IA en Argentina

99.99%

SLA de disponibilidad

AES-256

Cifrado en reposo

SOC 2

Auditoría de controles

ISO 27001

Gestión de seguridad

PCI DSS

Pagos protegidos

GDPR

Privacidad europea

HIPAA

Datos de salud