Sunday 19 August 2018

Salesforce Opportunity VS Custom Object

Constraint : 

Opportunity object is been used by many other projects in same production server
& Requirement is to upload the data into that object 
& Not required any standard Opportunity functionality like stages,forecast,relation ships to Products/Price Books / Quotes



Opportunity
Custom Object
More control
No
Yes,
Since it’s new there will not be any dependency on
  • Existing Settings
  • Code
  • Workflows
  • Process Builder
  • Triggers
  • Current functionalities
Data Import Wizard
No
Yes,
  • Since we have requirement of data upload OOB can be leveraged.
  • We can avoid code maintenance of custom built going forward
Rename Tab
Yes,
But same object is used by other teams not allowed to rename
Yes
Field Tracking History
Yes,
The limit is 20 and other teams already used that,So not possible.
Yes
Readily available stages
Yes
No
Probability Calculations
Yes
No
Indirect Lookup relationship Allowed as parent object
Yes
Yes
External Lookup relationship Allowed as child object
Yes
Yes
Account  Direct Relationship
Yes
No
Contact Direct Relationship
No
No
  • Forecast
  • OpportunityContRole 
  • Campaigning
  • Opportunity splits
  • Special relationship with Account and contact / Products / Pricebook / Quotes
Yes
No
Note :
Salesforce Unlimited license supports : 400 Custom Objects

Saturday 11 August 2018

Salesforce Data Security & Sharing Real Time Scenario's


1. What are the different way's to provide security in Salesforce?

1. Organization Level Security:

    • Network Access
    • Login IP Ranges
    • Login Hours

2. Object Level Security :

    • Objects
    • Permission Sets

3. Record Level Security :

    • Organization Wide Defaults [Private /Public Read Only]

4. Field Level Security :

2. What are the different ways of sharing a record?

  • Manual Sharing
  • Criteria Based Sharing
  • Apex Managed Sharing
  • Role Hierarchy Based Sharing
  • OWD Public Read /Write

3. When you see the Sharing Button  on a record?

If organization wide defaults of the object are Private /Public Read Only 

4. Can we use Permission Set for restricting the access?
No, Permission Sets are used to grant access.
Ex: Profile has permission on Lead & Account ,Only specific user of that profile need permission on Campaign object then permission set is created and assigned that to the user

5. If 2 profile users have same role will be able to see each other's record?
If Organization Wide Defaults on those objects are Private then not possible to see.

6. With whom can share record ?


7. Is it possible to rename tab and object name based on Profile / App?

 No,It's not possible,But an idea is posted for the same.Refer

8. Is it possible to restrict the visibility of list views by profile ?

It's not possible to restrict access with profiles.You can do using Roles & Public Groups. Refer.



9. How is record type access specified ?


By Profiles / Permission Sets or Combination of both





10.Explain scenario for Apex Managed Sharing?

Apex managed sharing used to share the records pragmatically,

StanrdObjectShare
MyCustomObject__Share

Ex: 
When lead converts to opportunity ,The owner of lead will not be able to view the opportunity So based on business requirement to provide the view then can be achieved using "Apex Managed Sharing" 

11.The "With Sharing" keyword enforces the user's permission, FLS, and sharing rules?

No,it only enforces sharing rules

12.A class declared as "with sharing" can call code that operates as "without sharing" ?
Yes,If an inner class is declared as “Without Sharing”,It will execute without enforcing the
sharing rules that apply to the context user.

13.What is Sharing Reason ?
Create Apex sharing reasons for individual custom objects to indicate why sharing was
implemented,
This allows users and administrators to understand the purpose of the sharing.

  • Only users with the “Modify All Data” permission can add, edit, or delete sharing that
  • uses an Apex sharing reason.
  • Deleting an Apex sharing reason will delete all sharing on the object that uses the reason.
  • You can create up to 10 Apex sharing reasons per custom object.
  • You can create Apex sharing reasons using the Metadata API


14.Configure child objects to be Controlled by Parent whenever possible can you avoid creating implicit shares?
True


15.What is the deferred Sharing ?
16.What is granular locking ?
17.Encrypted fields can be converted into another data type ?
The option to change the data type of a custom field is not available for all data types.
For example, existing custom fields cannot be converted into encrypted fields nor can
encrypted fields be converted into another data type.

Wednesday 8 August 2018

Salesforce Lightning Connect Real Time Exp


What is Salesforce Lightning Connect ?

This is a framework that enables to view,search and modify data that is stored outside Salesforce Org.
It is very effective way of data integration.



What are the benefits ?

  1. Real Time Data  Access: Data access is on-demand & Real time with out copying the data into your org can access external  data source.So no data duplication.
  2. Code Free : Completely code free,Can be achieved by points and click 

Any blockers to implement this solution?

Few things need to know ,Before finalizing this solution
  1. Additional Cost : Price starts  $4,000 per month per data source 
  2. External Data Availability Should be  by :  Either
    • oData API's - Refer
    • Custom Salesforce Connect Adapter - Refer (Or)

Using lightning connect Salesforce objects can be accessed by external data source?

No

Ex: SQL server  integrated to Salesforce through Salesforce lightning connect.

Case1 : SQL server tables will be accessible in Salesforce ? Yes
Case2 : All the Salesforce objects will be accessible in SQL Server ? No

How to access Salesforce Objects in External Data Source ?

By using ODBC / JDBC Drivers,
But Salesforce doesn't have any native ODBC/JDBC drivers as of today.Refer.

There are commercial solutions are available.
  • Easysoft
  • cData
  • devart
  • Progress

Lightning Connect  VS REST API ?

Lightning Connect uses OData Protocol and commonly accepted methodologies like REST for the web.

So question is,If we have other REST API already built to access the external data source,Then which will be better option among those two?

It depends on the project requirement,Design decision will be chosen

Lightning Connect
REST API
Directly allow  to access the external data source like custom object of Salesforce.Which called as external object.
Data will not able available in Salesforce, Each time on request get response and parse and show as per requirement.
Can directly build relationships.
·         Indirect Relationships
·         External Relationships
Can Use Salesforce Reports & Dashboards, Page Layouts
No, We cannot leverage any standard salesforce OOB functionality like Reports and Dashboards, Page layouts, Relationships.

Additional cost 4k$ /Per Data Source / Month
No additional cost
Dependency: OData API should be exposed on the data source, If already not available need to build for that particular data source.
No dependency

Lightning Connect replaces ETL tools ?

Not exactly,
ETL approch physically moves the data where as lightning connect does not.
So it's based on the use case need to choose the suitable solution. 

What is External object ?

External objects map to the data located outside your Salesforce org & It’s similar to custom objects.
o   External objects ends with “__x

Custom Object VS External Object ?


Feature
Custom Objects
External Objects
Data stored in your org
Yes
No
CRUD
Yes
Yes,
Write (Limited)
Tabs
Layouts
Visualforce
Field Level Security
REST & SOAP API
Yes
Yes
SOQL
SOSL
Report & Analytics
Chatter
Yes
Yes (Limited)
Sharing
Yes
No
Formula Fields
Workflows
Trigger
Batch Apex
Yes
Not Yet
Search
Yes
Yes (Limited)
Global  search only by text, text area and long text area fields


Indirect Look Up & External Look Up Relationships ?


External DataSource --> Validate And Sync :

On click of that button,Gives the refresh data from external system. 

Note : On click of Validate And Sync the relationships will be cleared,Need to create again ,Please think if required then only click on that button

External Object In Test class : Currently you can not get the external object in test classes,It needs to be implemented with a work around.

Name few enterprise built-in OData service?

  • Progress DataDirect Cloud
  • SkyVia
  • MuleSoft

Implementation using enterprise built-in oData Service - Progress DataDirect Cloud ?

DataDirect Cloud provides real-time connectivity to on-premise and cloud data

SNO
Task
More Details
1
SQL Server Database Login Details
SQL Server Database Credentials
·         User Name
·         Password
·         Database Name
·         Server Name
·         Port Number 

2
DataDirect Cloud Login Account
DataDirect Cloud provides real-time connectivity to on-premise and cloud data.
·         Create an account
·         Login à Downloads à DataDirect Cloud Driver Downloads à Install à Get the Connector ID
·         Login à DataDirect Cloud à Data Sources à Select SQLServer à Create SQL Server Data Source à Test Connection à On Success à Save
·         Configure SchemaàSelect Schemaà dboàSelect all the tables /views which would like to expose to Salesforce à Select the primary key on column
·         Go to OData  à Access URI

Note: This Access URI should be given in Salesforce  à New External Data Source à URL

3
Salesforce Login Account
Login à Set up à Build à Develop à External Data Sources à

Select like below values


Type
Lightning Connect OData 4.0
Parameters à
URL
OData  à Access URI from “DataDirect Cloud Login Account

Authentication àIdentity Type
Named Principal
Authentication àAuthentication Protocol
Password Authentication à Enter DataDirect Cloud Login à User Name & Password
Save à Validate and Sync à External Objects

Result: Finally exposed tables/views can find in the External Objects  J

Further : If would like to see in the external object in the new tab, Create new tab for each external object and configure the page layout accordingly to view the fields