You are on page 1of 11

Create Application:

Application : Star Pharma

Object :

Object : Pharma Product

Business type text


manufacturer text
Price currency
Product name text
Product specs text
Product type picklist
Stock remaining number
Category Small, medium, large
Sub Category Small1, small2, Small4, small3, Med1, Med2,
Med3, Large1, Large2, Large3

Object: Sample

Pharma product master detail relationship (Pharma Product)


Product code Number
Quantity Number
Visit Lookup(Visit)

Object: Invoice

Amount currency

Comment text

Doctor Incharge text

Final Amount Formula(currency)

Hospital Master-Detail (Hospital)

Hospital Email Formula(text)

Hospital Name text

Invoice Date Date

Invoice Id Number

Invoice Reg Number Auto Number

Status Picklist

Create below junction object:


Object : Pharma Product Invoice
Invoice Master-Detail (Invoice)

Pharma product Master-Detail (Pharma


Product)

Object: Visit

Visit Name text

FR Name text

Hospital Master Detail(Hospital)

FR Lookup(user)
Creating Salesforce Custom fields
When we talk about fields in Salesforce there are two types of fields they are

1. Standard Fields.
2. Custom Fields

Standard Fields :- In Standard Fields these are the four Standard fields get
created when an object is created.
 Name.
 Owner.
 Created By.
 Last Modified By.
As shown above four Standard fields are created when an object is created but
custom fields are not created by default.

formula field

we are going to create a formula field for Invoice Object. Here we are going to
create Formula for discount amount. Where the discount has to be applied for all
purchase above 500$.
If Invoice Amount > 500, final Amount = Invoice Amount -
(20/100*Amount__c), Amount__c).

Create cross object formula field on Invoice Object.


• If Invoice are related to another object then we can pull the fields from the
another object and populate the values in Invoice. As per previous
Salesforce Tutorial, Invoices are associated to Hospitals. Hospital is a
parent object of Invoices. If we want to create Hospital Email address
field for every Invoice record then using Salesforce Cross Object Formula
field we can create Hospital Email field in Invoice record.
Create Rollup Summary field on “pharma product “ Object

Label : total Sample Quantity:


Function : sum
Field to Agregate : Quantity

Q1: change the page layout of pharma product


Validation Rule:

Validation rules in Salesforce are the rules which contains a formula expressions
that validates our data and returns a value of “True” or “False.
 Validation rule contain Formula expressions.
 It evaluate the data entered by the user.
 Validation Rule displays error message to user when the enter invalid
values.
 We can create Validation rules in Salesforce for Objects, fields, campaign
members etc.

Examples of validation Rules.


1. Quantity cannot be Negative.
In Sample object we have a field called Quantity. Let us create a record in
Samples and enter the quantity value as negative.
As shown above the quantity field is -5o. In general the quantity field must not be
negative. In this case we have to apply validation rules. When ever a user enters
negative value for a field Quantity then a error message must be displayed to
Enter a positive value. Here we have to restrict user by entering negative value.
Field Dependencies in Salesforce
Field Dependencies in Salesforce are the filters that allow user to change the
contents of a picklist based on the value of another field.
Example :- Here there are two field called Country and State. We have to display
all states that are related to Country Field. Like wise Districts that are related to
States. Here one field is dependent on another field.
In Field Dependencies, we have to learn about two fields they are
1. Controlling Field.
2. Dependent field.
Controlling Field :- A controlling field is that which controls the available values
in one or more corresponding dependent field.
Dependent Field :- A dependent field displays values based on the value
selected.
 Custom picklists can be both Controlling and dependent field.
 Standard picklists field can only be used for controlling.
 Default values can be set for controlling field.
 We can not set default values for dependent picklist.
 Multi Select picklists can be dependent.
 Controlling field must be added to page layouts.
 In controlling field we can add up to 300 values.
Create List View on Invoice Object:
e.g: display all invoice which is created today.
Hospital
visit

lookup
m

You might also like