Sunday, 16 December 2018

Salesforce Best Release Management Exp

1.What is release management?
Release Management is the process responsible for planning, scheduling, and controlling the build, in addition to testing and deploying Releases.

2.What are the different types of releases you suggest in Salesforce Agile Projects?    

  • BAU (Business As Usual) Release : Whenever there is no dependency/new implementation can go with this release,Generally this happens for every sprint on  Mid of the day - Wed

  • MR (Monthly) Release : Whenever there is dependency on existing system like integrations or others should go with this release.So that both the teams can perform integration and regression testing.It happens generally on  Weekend - Sat


3. How do you collaborate between different teams for release?Ex:10-15 teams.
-->Design Meetings : This is 1st initial step should be in place to have a successful collaboration across different teams.
In this meeting generally  Product Owners & Architects will join discuss on the new requirements they are going to implement and list the affected common objects / code.The details will be highlighted and captured in the confluence documentation for reference across teams.
-->Release Meetings :
  • Fortnightly [In case sprint is 2 weeks]
  • Monthly
-->Release Management Checklist :Every team who is participating in the release of particular BAU /MR should fill the details of checklist.Ex:
  • Sprint number,
  • User Stories ,
  • Code /Schema changes, 
  • Common code/schema changes


4. What is the deployment flow?


Note : Create a separate branch for each environment and code merge should be taken care from moving from one environment to other and all the environment base code pulled from Master branch.

5. Which of the above environments are common across the teams?
  • SIT
  • UAT
  • Pre-Prod
  • Prod

6. Give your project release management flow ?
  •    Github as Code Repository
  •    GoCD pipeline for Continuous Delivery - [Branch Code → GoCD → Sandbox] -  This can be scheduled also.
  •    Beyond Compare used for code merge

7. Any suggestion for deployment?
Please take care of Profile deployment,Profile should have complete metadata from production and on top of that merge the new changes

8.  What is the rollback plan ?
Since many teams changes packaged and deploying together ,reverting specific project changes is difficult.Few workarounds.

1.Design wise should have flag basis option to disable the running of the code in case of deployment failure.

2.Deploy a quick or hot fix / missing component through changeset to make successful deployment
   

Thursday, 13 December 2018

Streaming API - PushTopic

1. What Salesforce Streaming API?
The Salesforce Streaming API is a simple way to push relevant data to your users in real-time, instead of having to refresh the screen to get new information.

This allows a user to get information without having to perform any action to retrieve it, essentially pushing new data to the screen.


2. Event-Driven (Pub/Sub) VS Point-Point Architecture Best Fit?

Event-Driven [Push Technology]
Point-Point [Pull Technology]
At some point enterprise system grows much and more complex and where decoupling of service is needed.There event driven architecture is the best fit.

When your infrastructure only has a few components, point to point integration can seem like a lightweight way to connect everything together.

3. What are the Streaming API events?

Event
Details
PushTopic  
PushTopic events track field changes in
Salesforce records and are tied to Salesforce records.
Generic
Generic events contain arbitrary payloads.



4. Explain Streaming API PushTopic event?

You can use Streaming API to keep your external source in sync with your 
Salesforce data with PushTopic events and Change Data Capture events.

Streaming API lets you process business logic in an external system in 
response to data changes in Salesforce.

Ex: Notify a fulfillment center whenever an opportunity is updated.

PushTopic Supported Objects :
Supports all Custom Objects & Below mentioned Standard Objects

Campaign
ContractLineItem
Case
Lead
Entitlement
ServiceAppointment
Account
Quote
ServiceContract
Contact
QuoteLineItem
WorkOrder
Opportunity
-
WorkOrderLineItem
Task
-
LiveChatTranscript

PushTopic Important Points :

1.The SELECT  statement's field list must include Id
2.Only 1 object per query is allowed
3.Aggregate queries or Semi-Joins aren't supported
4.Subscribers receives all stored events after the events specified by its replayId value and new events.
5.Limit the stream of events to only those events that match a subscription filter,Only PushTopic has this feature ,Same is not available in Generic /Platform Events.
6.Clients & Timeouts  - As a supported in the Bayeux protocol
  •   Socket timeout : 110 Seconds
  •   Reconnect timeout : 40 Seconds


PushTopic Governor Limits: Refer
PushTopic Implementation Example :
1.Apex :

PushTopic pushTopic = new PushTopic();
pushTopic.Name = 'ContAddUpdate';
pushTopic.Query = 'SELECT Id,Name,AccountId,MailingCity,MailingStreet'+
          'FROM Contact Where AccountId = 016F000032XRPhQAO';
pushTopic.ApiVersion = 43.0;
pushTopic.NotifyForOperationCreate = true;
pushTopic.NotifyForOperationUpdate = true;
pushTopic.NotifyForOperationUndelete = true;
pushTopic.NotifyForOperationDelete = true;
pushTopic.NotifyForFields = 'Referenced';
insert pushTopic;

2.WorkBench: Publish & Subscribe - Change Data Capture on records






How to delete PushTopic :

There are 2 options,Either deactivate /delete 

Deactivate :
PushTopic pt = new PushTopic(Id='0IFD0000000008jOAA', IsActive = false); update(pt);
Delete : Apex
List<PushTopic> pts = [SELECT Id FROM PushTopic WHERE Name = 'Channel'];
Database.delete(pts);

Delete : Workbench
Select queries -> Streaming Push Topics -> select your push topic --> Details --> Delete




Saturday, 1 December 2018

Salesforce Microservices


1. What is Microservice?

  • Microservice is self contained process that provides unique business capability.
  • Microservice is responsible for its own data model and data
  • Microservice communicate each other through REST/Messaging Queue

2. Microservice Architecture?



Note: This architecture mainly used by E-Commerce application

Ex: Amazon

3. Monolithic Architecture?

Monolithic Architecture is like a big container where in all the software components of an application are assembled together and tightly packaged.

Drawbacks : Over time,Coupling becomes tighter and tighter


Note: Still many company's are using this architecture
Ex: Facebook

4. What are the Pros And Cons Microservice Architecture?


SNO
Pros
Cons
1
Loosely coupled
Distributing computing adds complexity and slows down initial development
2
Decoupling to provide scaling
Inter-service communication complicates development,Potentially unreliable connections require fault tolerance
3
Language Neutral - Can be written in any language and framework ,Each can be communicated with REST/Messaging queue
Testing can be more complicated,When needs to test entire enterprise application
4
Independent Development & Deployment
Inter-service security & Identity Management
5
Scalable

6
Updatable

7
Fault Isolation - [Even though other connected service is having issue the current service will not break]



5. Salesforce Sales/ Service Cloud built on Microservice Architecture?


No,But Salesforce supports connecting to Microservices built on other technology and can built custom Microservice using APEX

6. Companies using Microservices ?


7. References :


Tuesday, 20 November 2018

PackageBuilder & GitHub


1. How to download all the metadata from sandbox / Generate package.xml of all the components?

There are many ways to do this,Please Refer1,Refer2
     I used the this tool https://packagebuilder.herokuapp.com/
   


2. How to upload code to GitHub & Expose to publicly?

     
1. Sign Up
2. Create new repository
3. Commit one file [Ex: ReadMe file] to get the Upload Files button option for drag and drop files easily.
          
       







Thursday, 15 November 2018

SFDC Lightning Interview Questions



Before FAQ's,For quick understanding of Lightning Component Framework Refer


1. Why we should use lightning over VF ?


Lightning Component Framework
Visualforce
App Centric
Page Centric
Lightning Components process markup on the client.
Visualforce processes markup tags on the Salesforce server
Lightning, on the other hand, is a modern UI framework used in the development of dynamic web apps for desktop and mobile devices.
Visualforce enables developers to build custom user interfaces with a native hosting on the Force.com platform
It is responsive,
If you are developing for a Salesforce1 mobile app, you should prefer Lightning framework
If you want to create a page-centric experience with limited client-side logic, you must opt Visualforce framework.
UI Generation : Client-Side(Javascript)
UI Generation : Server-Side
Organizations that can’t use Apex code can’t use Lightning Components
Organizations that can’t use Apex code Still they can use Visualforce.
These applications are generally referred to as single-page applications, or SPAs, and are often built using third-party frameworks like AngularJS or React.
Visualforce provides the facility for delivering template-driven web pages and email messages
Fast Development,Client side & Server side work can be done independently
Its tightly copulped so development will have dependency.

1. Lightning Component Development will be faster because Client side and Server side task can be implemented independently.

2.Web applications are taking more advantage of the app-centric model,So it’s better to start with  Lightning.


2. Does lightning support all the browsers and versions ?



Lightning Experience is supported with Microsoft® Internet Explorer® version 11,Apple® Safari® version 8.x on Mac OS X. The most recent stable versions of Mozilla® Firefox® and Google Chrome™ are also supported. If you’re using Microsoft® Internet Explorer® versions 7–10, you’re redirected to Salesforce Classic. Refer
Real Time Exp:In order to support IE 11 we need to explicitly opt in for it in lightning experience settings. But since these settings are applicable for all users and turning it on could expose some security risks, so I have advised them to use another browsers for logging into salesforce.


3. Lightning Vs VF page - What is not possible with Lightning ?



1. Force.com sites directly doesn’t allow lightning components to add, Need to use VF page and host Lightning Component / App

2.If you are rendering pages as PDF in your application use Visualforce. Lightning components don’t support rendering as PDF output yet.


4. How can we embed VF page in Lightning Component ?


Use iframe to expose your visualforce pages within a lightning component

 



5. Have you faced the below error?Lightning components require My Domain. Please contact your system administrator for more information ? How did u fix that?



Yes,It will occur when the domain is not deployed to users.Fix : Setup-->Domain management -->my domain click on the button "Deploy to users"


6. How to create a lightning component to send email to salesforce ?



Ideally there is nothing from lightning component to send an email,To trigger email from lightning component there are few options

1.Apex : Use the lightning component to take the i/p parameter and pass that to  Apex.
2.Workflow /Process Builder : Trigger an email on save of the record and the lightning component has the logic to save the record then it triggers.
3.Call out to External Email Service: This is also via Apex instead of using our email service, you   could make a callout to an external email provider.Refer

7.  Experience with Custom Lightning Components ?


Yes worked in multiple projects,
1. Calendar lightning component is created for Tele Interviewer Booking
2. Display of report links & Knowledge Article links
3. Registration form

Issues :
1.Verify the component is loaded or not before communicating to other component. To avoid null exceptions.
·        Pseudocode :Create isLoad Boolean attribute with default value as false and in call back method on successful  return update this value to True.
2.One.app is needed and is available in lightning exp,It will not work in other container
          Ex: Force.com Sites
3. Collection with lot of data,Rendering issues.- Member,dependents
4. Single page application should not have large volume of data
5. Debugging is always challenging → Inspect elements
         

8. Explain your experience with Lightning Experience? Any migrations from classic to LEX?

Lightning Experience is a modern user interface that helps your sales reps sell faster and your service reps support customers more productively.
Lightning Experience includes many new features and entirely redesigned pages, but not every Salesforce feature is supported in Lightning Experience.

Note :

1.There is feature gap between Classic & LEXEx: Some works in classic /Some new features available only in LEX.

2. Salesforce product team is focusing on and moving forward with lightning,So it's better to migrate to LEX and Start any new development in LEX instead of Classic.
Ex:Financial Services Cloud (FSC)

Migrations from classic to LEX :

What will be the estimation ?
Depends on the complexity,If it is large enterprise client it may take multiple years.
Impact Analysis :
1.Generate “Lightning Readiness Check” report for Classic to LEX migration.
2. Domain Creation → Lightning exp enabled → 2 users as lightning users → To test completely
3.3rd party Apps of the Appexchange,Should get the lightning compatible version. 4.Sandbox wise also it will not work ,Need to check in all the environment
5.Rewrite or Refactor of some code may be needed to perform the functionality  correctly.
6.If you have custom buttons that use a JavaScript, you can use the Configuration Converter to convert these buttons and links to Lightning-Friendly alternatives since the JavaScript content source isn’t supported in Lightning Experience.
Alternates JS buttons :
  1. Lightning Quick Actions 
2. Custom Lightning Components     
7. Home page components need to be created again after migration,Reports and Dashboards  will not work,     
8. Classic & Lightning email templates need to be created differently     
9. VF pages with will not render in lightning properly,
Ex: Contact with 2 VF sections migrated to lightning

9. How we can do testing of UI / Lightning components ?


Lightning Test Service (LTS)  : Is a set of tools and services that let you create test suites for your lightning components using standard javascript test framework,Such as Jasmine and Mocha.   
Installing the LTS : There are 2 ways
1.Use the Salesforce DX CLI.
2.Manually install the unmanaged package. Refer


10. What is lightning out. ?

Lightning Out is a feature that extends Lightning Apps and acts as a bridge to surface Lightning Components in any remote web container.
This means you can use your Lightning Components inside of an external site,
1. Sharepoint ( Hybrid app built with the Mobile SDK)
2. SAP ( Hybrid app built with the Mobile SDK)
3. Heroku (App Cloud)
4. Visualforce (VF)
5. Node.Js Application        
Note : For external system mashups you will need to 1st establish connection with SFDC using connected apps.
Ex: Classic Console with  Lightning Out App Lightning Aura Application :        

:


11. What is lightning and how it is different from classic. ?



Lightning Exp :The overall intent of the redesign is to make the data and tools more accessible.
Setup → Lightning Experience → Enable It
Note : There will be few gaps & Limitations compared to classic salesforce team is fixing and releasing periodically.Refer

12. What is design tab used for in lightning bundle ?

There mainly 2 uses :
1. Design attribute is a configuration for admin.Anything wanted to expose to admin to enter that attribute can be made as design attribute.
Ex: Same component can be used in multiple applications by just passing the different design parameters.
Ex: Object in one component ,Then it should be placed in multiple other application for different other object ,Lightning page data table



2. Restrict the component based on object in lightning app builder.Map the lightning component only in particular object(s) lightning pages then we need to use <sfdc:object> tag in design resource.
Refer

13. How do l call one lightning component from another ?

A native lightning event “e.force:navigateToComponent” that will allow you to navigate from one lightning component to another. Traditionally, to get this done,you had to write your own lightning event.
Note : It will redirect to next component


Event Types:
Component events are parent-child relationships, in which an event registered in the child component can be handled only by the parent and not other sibling components.

Application events, on the other hand, are for sibling relationships. They can communicate with any other component.

The type of component is determined by the event file itself by setting the attribute on the <aura:event> tag to either COMPONENT or APPLICATION.

Lightning Component Communication Patterns : Always best practice is use Attribute/Methods while passing down the data & Use events while passing up
the data.


Application Event :


Register → Event Fire with parametersHandler → Receive and read the passed parameters var message = event.getParam("message");

Refer1

14.What is the role of helper in Lightning bundle ?

1.Reusable code need to be written in the Helper class, Code shared by your renderer and your controller or by multiple controller functions.That should go in the helper JS file.    
2. Helper code can be shared among components when they are related through inheritance. If one component extends another it inherits its super component's helper and can override it.           
3. Code Modularization - Send different parameters to same method
Ex:




Real time experience where forced to use helper over the controller           
Ex: Auto Refresh i have written a method it was allowed to place in Helper class

Best Practice :
Should try to delegate business logic to Helpers whenever possible.      

2. Anti-Pattern(s):Too many functions in the Helper: If you get into this situation, it’s time to refactor  the component itself into smaller sub components.    

Controllers v/s Helpers ?
Use Controllers to listen to user events and other events like component, application events. But delegate business logic to helper.

15. How to call apex controller without any button in lightning ?

1.On Standard events it can be called,
Ex: onInit / OnLoad      
2. AfterScriptsLoaded in Lighting Component  → 3rd party Js is loaded if we wanted to invoke apex    
Ex: Controller.js will be called after 3rd party JS is loaded

16. How to use slds in lightning ?

1. The Salesforce Lightning Design System (SLDS) provides a look and feel that’s consistent with Lightning Experience.

2. Use Lightning Design System styles to give your custom stand-alone Lightning applications a UI that is consistent with Salesforce, without having to reverse-engineer our styles.

3.The component is being rendered in the one.app container, SLDS will be available to your component automatically.

4.The Salesforce Lightning Design System is ready to use in your Lightning apps and components. It is now automatically included for Lightning Components running in the Lightning Experience and Salesforce S1 mobile application. It is no longer necessary to add a static resource for Lightning Components running within these environments.

Latest Way : Introduced in winter'16
Your application automatically gets Lightning Design System styles and design tokens if it extends


<aura:application extends="force:slds">
   <!-- customize your application here -->
</aura:application>

Older Way :  
This feature not available now.To use the static version of the Lightning Design System in a component, include it using <ltng:require/>


Refer1

17.What is the use of rerender in lightning bundle ?

Renderer service in lightning component bundle modify the DOM elements which is created by framework for a component. We use custom renderer to change override the default rendering behaviour of the component.Refer

18.Lightning Locker Service ?

Security Model for Lightning is locker service It is enforced by the system to limit the ability of one component's code to access other components on the page.

Why do we need security ?
Opens up lot of data to DOM,There is a threat to customer data




One lightning component has the access to other lightning component render data.

19. Lightning button Vs UI button ?

The lightning namespace components are optimized for common use cases. Beyond being equipped with the Lightning Design System styling, they handle accessibility, real-time interaction, and enhanced error messages.