If you are an admin or business analyst trying to identify business rules coded in your salesforce org, there is always a challenge on where to find them, how to identify them and even talk to your developers who can help you identify this in apex and flows. The best practice will be to document this on stories and use tools like Elements cloud for this but we all know how budgets are and it is hard sell to get the leadership buyin for a product. So as an Architect, admin or IT manager who wants to identify business rules in your salesforce org, the question is where to start? How to identify business rules and how can you help your fellow developers and admins to document them? The below blog will provide you guidelines for you to follow.
Disclosure: I have used Chatgpt for memes and some definitions!!!
Create a definition for business rules
When I asked Chat Gpt the question, here is the guideline it came up with.
In a Salesforce implementation project, a business rule is a specific, predefined guideline or constraint that governs how business processes and workflows should function within the Salesforce system. These rules ensure that the implementation aligns with organizational policies, objectives, and compliance requirements, while also defining the behavior of the system under certain conditions.
Key Characteristics of Business Rules:
- Contextual: Tied to specific business processes (e.g., sales, service, marketing).
- Prescriptive: Define what actions should or should not be taken in certain scenarios.
- Automatable: Often implemented using Salesforce features like validation rules, workflows, flows, or custom Apex code.
- Enforceable: Ensure data integrity, process consistency, or compliance with legal and organizational policies.
- Dynamic or Static: Can either be static (fixed and unchanging) or dynamic (adjustable based on conditions or user roles).
Example Business Rules in Salesforce:
- Validation Rule: “Opportunities must have a close date that is later than the current date.”
- Approval Process: “Discounts greater than 20% require manager approval.”
- Data Management Rule: “Duplicate accounts cannot have the same combination of account name and billing address.”
- Security Rule: “Only users with the ‘Finance’ profile can access sensitive financial reports.”
- Field Updates: “When an Opportunity is marked as ‘Closed Won,’ the related Account’s status must update to ‘Active Customer.'”
To simplify, you can use the following definition for a business rule.
Behavior Constraints:
- Does the logic enforce a specific behavior or limit actions based on business policy (e.g., “Discounts above 20% require approval”)?
Conditional Logic:
- Are there conditions tied to specific outcomes (e.g., “If status is ‘Closed Won,’ set account type to ‘Customer'”)?
Data Integrity:
- Does the logic ensure data correctness (e.g., validation of email format, mandatory fields)?
Compliance Requirements:
- Are there rules to meet legal, regulatory, or organizational policies (e.g., “GDPR opt-in required for marketing communications”)?
Process Governance:
- Does the logic enforce an approval, escalation, or notification process?
Once the scope of the business rule is defined, the next step of the process is to look for areas in Salesforce and identify them.
Identify Business rules in Salesforce.
Once the scope of business rules is defined, it is time to examine the areas where they are stored. Here are some common components you can use to identify the business rules.
- Flows
- Validation rules
- Worflow rules
- Apex classes
- Triggers
- Custom Metadata
- Business rule engine
- Expression set
- Custom setting
- Sharing Rules
- LWC or Visual force pages for conditional Logic for display
Here are some examples as you dig into the components to identify business rules.
- If you see a validation rule, workflow rule, or entry condition in a flow, I would call it a business rule because it executes based on a condition.
- Any computation or calculation done in a flow, apex class is a business rule
- Any flow paths based on If logic, else logic, or if else other logic is also a business rule
- Any if else statement, computation in apex class is a business rule
- Any error messages displayed on the screen based on a condition is a business rule.
- Loops can be business rules if they do a calculation.
- If a status field update is done by a flow or apex, it is a business rule.
Documenting and Explaining to the Business users.
Once we identify the components for identifying the business rules, the next question is documenting them and explaining to the users. Here are some guidelines on documenting business rules.
For simple documentation, you can follow this format.
- If xxx( condition), System does (XXx), which impacts (xxx)
- E.g
- If opportunity stage is proposal, System displays alert message if the probability is less than 50 percent. This impacts the sales process.
- If discount amount is greater than 10 percent of opportunity amount, System displays alert message to the user to notify manager.
- If you are looking to document this on a slide or word document, you can follow the below format which is listed on the table.
Business Rule # | Description | Context(Process and who) | Where |
BR-01 | If opportunity stage is proposal, System displays alert message if the probability is less than 50 percent. | This impacts the sales process for sales reps | Validation rule Opportunity object |
BR-02 | If discount amount is greater than 10 percent of opportunity amount, System displays alert message to the user to notify manager. | This impacts the discount process for sales reps and sales operations team. | Flow Opportunity Line item object |
What is not a business rule
Sometimes developers and admins might get over bored and document a lot of things in apex classes and flows. Do you know of a developer who loves to document?? So here are some guidelines you can tell your admins and developers to ignore on business rules.
- variables assignment
- setting values to variables
- Loops which are technical to set values to variables for computing totals etc
- Every insert or update statement in an object.
If you are in a situation to reverse engineer an existing salesforce implementation and document business rules, here are 3 steps you need to follow.
- Define what is business rules.
- Provide a list of componets on where to find the business rules.
- Provide guidelines on how to document the business rules and explain to the business users.
As always, please post your comments or email me at buyan@eigenx.com for further questions.
Please subscribe
Subscribe to our mailing list and get tips to maximize salesforce to your email inbox.
I am honored to have your subscription. Stay tuned for tips to maximize your salesforce investment
Something went wrong.