Monday, October 30, 2017

Real-time Sync of Salesforce Data using Change Data Capture (Pilot)


New feature of Winter'18 release -

The purpose of this article is to share how can we receive near-real-time changes of Salesforce records, and synchronize corresponding records in an external data store.

What is CDC (Change Data Capture Pattern)?

Change Data Capture as the name suggests is a design pattern to track changes in data so that an action can be taken based on the change. Changes include creation of a new record, updates to an existing record, deletion of a record, and undeletion of a record. CDC is common in most of the ETL tools however it is design pattern to track any data changes in any data repository that could be data warehouse or data bases. Data change events are published on a channel (the event bus) when changes occur in Salesforce.

For example, you have a human resource (HR) system with copies of employee custom object records from Salesforce. You can synchronize the employee records in the HR system by receiving data change events from Salesforce. After receiving the events, you can process the corresponding insert, update, delete, or undelete operations in the HR system. Because the changes are received in near real time, the data in your HR system stays up to date.

Note - Available in: Performance, Unlimited, Enterprise, and Developer Editions. This is a pilot program and Change Data Capture isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. Make your purchase decisions only on the basis of generally available products and features.

Event Subscription -

To subscribe to data change events, use CometD the same way you subscribe to other streaming events, like PushTopic events or platform events.

Subscription Channels -

a) The channel to subscribe to all data change events is: /data/ChangeEvents
b) The channel to subscribe to data change events for a standard object is: /data/AccountChangeEvent (for Account object)
c) The channel to subscribe to data change events for a custom object is: /data/Employee__ChangeEvent (for Employee__c object)

Example: This data change event is sent when an account is created.

{
"data": {
"schema": "IeRuaY6cbI_HsV8Rv1Mc5g",
"payload": {
"ChangeEventHeader": {
"entityName": "Account",
"recordIds": [
"001R0000002aV0B"
],
"changeType": "CREATE",
"changeOrigin": "com.salesforce.core",
"transactionKey": "001b7375-0086-250e-e6ca-b99bc3a8b69f",
"sequenceNumber": 1,
"isTransactionEnd": true,
"commitTimestamp": 1501010206653,
"commitNumber": 92847272780,
"commitUser": "<User_ID>"
},

"Name": "Acme",
"Description": "Everyone is talking about the cloud. But what does it mean?",
"OwnerId": "<Owner_ID>",
"CreatedDate": "2017-07-25T19:16:44Z",
"CreatedById": "<User_ID>",
"LastModifiedDate": "2017-07-25T19:16:44Z",
"LastModifiedById": "<User_ID>"
},

"event": {
"replayId": 6
}

},
"channel": "/data/ChangeEvents"
}


For getting the list of supported standard objects and Salesforce release note on this, visit the below link -
https://releasenotes.docs.salesforce.com/en-us/winter18/release-notes/rn_api_data_change_events.htm

Monday, October 23, 2017

Salesforce Certified Platform App Builder – Transition Exam (SU-17)


Hi All,
Today, I have cleared my Salesforce Certified Platform App Builder–Transition Exam (SU-17) and here are the tips from my side to clear the exam:
1) Go through the training resources given in “SECTION 4. RECOMMENDED TRAINING AND REFERENCES” in the exam guide available at https://www.google.com.au/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjjtYTppPnUAhXFx7wKHdhqCMQQFggoMAA&url=http%3A%2F%2Fcertification.salesforce.com%2FSG_CertifiedPlatformAppBuilderTransition.pdf&usg=AFQjCNGl2oWzGI-d9lbhQZlCfiFBZtmGFw
2) Go through “Platform App Builder – Full Question Set” as given in http://sfdcstudy.org/platform-app-builder-quizzes/ and also the below one -https://www.proprofs.com/quiz-school/quizshow.php?title=transition-app-builder&q=15&next=y
3) Also here I am sharing some sample questions which I found in my exam -
I) Universal Container installs an unmanaged package. Which of the following are true: (Choose 2 answers):
A. Unmanaged packages can be upgraded
B. Components of unmanaged packages can be edited
C. Unmanaged packages have a namespace prefix
D. Unmanaged packages don't have a version number
E. Tests are executed during deployment
II) What would the proper field type be to allow users to enter multiple paragraphs (Choose 2 answers):
A. Text Area (Rich)
B. Text Area
C. Text Area (Long)
D. Text Area (Super Long)
E. Text
F. Text (Encrypted)
III) On an object called "Building", when the building is changed from "Commercial building" to "Residential building", some fields are not relevant anymore and should not appear on the page. What is the recommended solution to eliminate the fields that are no longer relevant?
A. Create a separate Residential object and use a workflow to clone the existing Commercial
B. Create a criteria-based sharing rule to help with access to the record
C. Create a Residential record type to control the page layout for the object
D. Create a separate Residential object and use a trigger to clone the existing Commercial object
IV) What is a true statement regarding case assignment rules? (Choose 3 answers):
A. A predefined Case Team is mandatory for each rule entry
B. Salesforce processes case assignment rules before workflow rules
C. They allow for more than one active rule at the same time
D. They allow for more than one rule entry for each assignment rule
E. They allow cases to be assigned to a queue
V) Which is true about social accounts:
A. You can use social accounts data even when you are not logged into the social account.
B. You need a personal social account in order to see social account data
C. You can use social accounts to import data into salesforce
D. Connection to social account is established thru a company wide "named principal"
VI) Universal Containers wants to rollout new product bundles with several pricing options. Pricing options include product-price bundles, account specific pricing and more. Which product satisfies the needs (Choose 1 answer):
A. Custom AppExchange-app for product-pricing
B. Workflow on Opportunity/Opportunity Product
C. Formula fields on Opportunity/Opportunity Product
D. Lightning process builder
VII) An admin is trying to add a custom VF page to the mobile app quick navigation menu but can't. What might be the problem?
A. The smart search is not enabled for the VF page
B. The VF page references / fields that the user can't access
C. A tab has not been created for the VF page
D. The menu configuration has not been set up correctly for the VF page
I got almost 90% of the questions in my exam from the above links, so this would suffice mostly, unless you are not lucky:)
Please let me know for any questions.

Thursday, October 5, 2017

Shield Platform Encryption In Salesforce


a) What basically Encryption mean?
At its most basic level, encryption scrambles information so that only those people with the right decoder key can unscramble it.

b) What is Shield Platform Encryption?
Salesforce Shield lets customers see who is doing what with sensitive data, know the state and value of their data going back up to ten years, and encrypt sensitive data at rest, while still preserving business functionality. 

c) What Kind of Data We Can Encrypt?
We can encrypt phone numbers, dates, names, text files, images, etc. If it’s recorded digitally, you can encrypt it. Shield Platform Encryption encrypts data at rest, meaning that we encrypt it when it’s being stored within Salesforce.

d) 'Shield Platform Encryption' Basics -
  • 'Keys' do the scrambling and unscrambling, and 'Secrets' keep your keys safe and working properly. Tenant secret partners with the master secret in what’s called a key derivation process to create keys that encrypt and decrypt your data. Master secret gets updated once per release, but you can update your tenant secrets as often as you want.
  • Shield Platform Encryption is available for free in Developer Edition orgs. 
  • All other editions require you to purchase a license. With Shield Platform Encryption, you can encrypt all kinds of confidential and sensitive data at rest on the Salesforce Platform. “At rest” means any data that’s inactive or stored in files, spreadsheets, standard and custom fields, and even databases and data warehouses.
  • The data is encrypted with a stronger 256-bit AES key.
  • Shield Platform Encryption even allows you to search for encrypted data in databases.
  • To generate 'Tenant Secret' key, goto Setup, enter Platform Encryption in the Quick Find box, then select 'Platform Encryption' and then select 'Generate Tenant Secret'.
  • You can 'Export' and also 'Import' the tenant secrets keys in order to regain access to data.
  • Best practice is to generate new tenant secret at frequent intervals. This process of generating a new tenant secret and archiving the old one is called key rotation. 
  • Archived tenant secrets can’t encrypt new data, but the app uses these archived keys to decrypt the data that was previously encrypted with it.
  • Remember, encryption doesn’t take the place of field-level access controls.
  • As with encrypted fields, encryption for files and attachments affects only files and attachments created after encryption is enabled. Enabling encryption doesn’t automatically encrypt files and attachments that were already in Salesforce. To encrypt all of those files that lived in Doc’s org before you enabled Shield Platform Encryption, contact Salesforce for help.

e) How to Enable Shield Platform Encryption in Salesforce -
  • Provision your license. Contact Salesforce to get one. Shield Platform Encryption is automatically available in Developer Edition orgs created on or after the Summer of 2015.
  • Assign permissions - need the “Customize Application” and “Manage Encryption Keys” permissions. However, you likely don’t want everyone managing encryption keys. Assign permissions with these scenarios in mind.

Permissions for Shield Platform Encryption
  • Enable Shield Platform Encryption for your org.

f) Limitations under Shield Platform Encyption - 
A security solution as powerful as Shield Platform Encryption doesn't come without some tradeoffs.

i) Shield Platform Encryption and the Lightning Experience -
For more details on this, refer to below link
https://help.salesforce.com/articleView?id=security_pe_considerations_lightning.htm&type=5

ii) Field Limits with Shield Platform Encryption -
For more details on this, refer to below link
https://trailhead.salesforce.com/modules/spe_admins/units/spe_admins_get_started

Happy Weekend Friends!!!! 😊