Welcome to www.ForcePrepare.com
Your tool for Salesforce.com Certification
home | tutorial | Mock Exam
Salesforce Business Logic
Business logic is a set of rules and calculations that handle information exchange between User Interface and Database.
Declarative Business Logic includes: Queues, Workflows, Validation and Assignment Rules, Rollup summary fields, Cross Object fields.
Programmatic Business Logic includes Apex, Visualforce Controllers, Web Services API.
Automated processes are:
Queues are used to manage a shared workload more effectively.
- Validation Rules
- Assignment Rules
- Auto Response Rules
- Workflow Rules
- Escalation Rules
Validation rules can be attached to fields. They are executed when a record is created or updated.
When defining a validation rule, an error condition and error message are defined. If evaluation of error condition results in true value, record is not saved, and the error message is generated. To get more knowledge on Validation Rules visit www.npsphelper.com/admin
Some fields are of type Formula. They are derived from other fields. Validation rules and formula follow
the same expression language.
A set of functions used in Formulae are included below.
A few things on these functions:
|TODAY()||Returns todays date|
|IF(expr,x,y)||if expr is evaluated to true, x is returned, else y is returned|
|TEXT(field)||Returns the text value of a picklist|
|ISPICKVAL(field,value)||Checks whether value of field matches the input parameter. Returns true if there is a match|
|ISBLANK(field)||Returns true if field is blank|
|AND(expr1,expr2)||Performs a logical AND|
|OR(expr1,expr2)||Performs a logical OR|
|HYPERLINK(url,text)||Creates a link to the specified url|
|ISCHANGED(field)||Checks id the field's value has changed|
|PRIORVALUE(field)||Returns the previous value of field|
|ISNEW()||Returns true if a new record is being created.|
|INUMBER()||Returns true if the field is a number|
|IMAGE()||Used to display an image|
|REGEX()||Compares a text field to a regular expression and returns true if there is a match|
|VLOOKUP()||In an object consisting of key value pair, VLOOKUP returns value for a key|
- Case(), If() and IsNumber() are available for all features like approval, workflow, validation and formula.
- Image() is only for Formula fields.
- Vlookup() is for Validation rules.
- IsChanged() and PriorValue() are for workflow, only when “everytime a record is created or updated”.
You can make your own formula. Go through the Formulas in Salesforce video at www.npsphelper.com/admin
Methods are used in Formulae fields, Validation rules, Workflow rules, Field updates, Default values and Approval process.
Some of these methods are only available in certain areas. CASE, IF, ISNUMBER are available in all places. IMAGE is available
only in formulae fields. VLOOKUP is available only in validation rules.
Cross-object formula span two or more objects by referencing merge fields.
Difference between Roll Up and Cross Object Fields:
- In cross object formulas, we navigate from child object to parent or grand parent object(up to 5 levels). Field is displayed on child object. While in Roll Up Summary Fields, we navigate from Parent to Child object.
- Formula fields do not store the value on the record but Roll Up Summary fields stores the value and changes can be seen on parent.
Limitations of Cross Object Fields:-
- You can’t reference cross obect formula in roll up summary field.
- You cannot reference merge field for objects related to activities.
- You cannot reference record owner merge field for any object.
View Setup Audit Trail is used to view list of configuration changes. It is available in Security Controls menu in the Setup area.
Examples of audit trail are creation of object, adding a new field, changing field type or setting up a new approval process.
By default 20 last configuration changes are displayed. Changes made in last 180 days can be exported into a csv file.
It can be configured by admin or developer.
Field history tracking can be enabled at object level at the time of creation of objects. Up to 20 fields can be tracked for one object.
As an example, any changes in field values are stored as part of Field history tracking. During Field history tracking, Time of change, user who made the change, prior value and new values are stored.
For data types Multiselect Picklist and text area (long), previous and new values are not saved.
In the Custom Fields and Relationship area of Object configuration, "Set History Tracking", is used to enable field level tracking. Review History
related list can then be added to page layout to view changes to fields.
Force.com platform provides three main mechanisms for debugging errors. These are also known as Auditing tools:-
- Field history allows developers to track changes to field values of up to 20 fields for any object.
- Debug Logs is a persistent store in which logs are stored for transactions performed by up to 20 users.
- System Logs allows developers to run apex commands and view the logs
- Setup Audit trail allows developers to view all configuration changes (example creation of object, changing field type, creating a workflow etc.) made in last 180 days.
Setup Audit Trail of Salesforce is used to track configuration changes made. Example of configuration changes are
date of change, description of the change, user who made the change. Twenty most recent changes are displayed in the audit trail.
Last 180 days changes can be exported into a csv file.
View Setup Audit Trail feature is available via the Security Control menu.
There is a link to System Log at the upper right corner of the page. System Log allows developers to enter Apex code and see the results of running this code.
System Log display information about workflow rules, validation rules, debugging information and resource utilization.
To control quantum of logging, system log takes two parameters Log category and Log level. Log categories can take the following values -
Log level indicates level of detail in the message. It takes the following values
- Apex code
- Apex profiling
Debug log is an organization-wide persistent log. It can store debug log for transactions performed by specific users. Logs for up to 20 users can be persisted.
Debug Log is available via the Monitoring menu.
Salesforce supports history tracking on change in values of fields. This can be enabled for up to 20 fields in an object.
In Custom Fields and Relationship, set history tracking is enabled for a set of fields.
Review history can be added to page layout. Information stored includes - changes to field values, time of change, user who changed the field.
Old and new values of fields are not stored for multi-select picklist and long text area.
home | tutorial | Mock Exam