ads

Thursday, 16 August 2018

Embed Flows in Visualforce Page

By using <flow:AccountTeam> component we can add a flow to a VF page.

Code Format:


<apex:page standardController="Account" tabstyle="Account">

<flow:AccountTeam name="AccountFlow">
<apex:param name="Accountsite" value="{!Account.Site}">
</flow:AccountTeam>
</apex:page>

Monday, 13 August 2018

Multiple substitution in salesforce function

We have to use nested SUBSTITUTE() methods for multiple replacing of characters.

Code Format:

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(FirstName," ", ""),"  ", ""),":","" )

In above code we are removing space, double space and colon.

How to Resolve Error : Incorrect Parameter type for operator '&'


This error generally come when we are trying to concatenate two fields values into a single formula field 

To resolve this issue we can use TEXT() method.

Code Format :

TEXT(BirthDate__c) & TEXT(Total_Employees__c)


Note : BirthDate__c is a Date Field and Total_Employees__c is Number Field.

Execute validation rule only for update operation

We can apply validation rule only in update operation in Salesforce by using NOT(ISNEW()) 

code Format:



AND( NOT(ISNEW()),

 ISCHANGED( address__c ),

 ISCHANGED( city__c ),

 ISCHANGED( country__c)  

)

How to restrict users to update picklist value



trigger AccTrigger on Account (before update) {

    for(Account Acc : trigger.new) {

        if(trigger.oldMap.get(Acc.Id).Industry == 'Electronics') {

            Acc.addError('Industry cannot be updated from Electronics');

        }

    }

}


Output Screen:

Thursday, 9 August 2018

Salesforce Certified Platform Developer I – Spring ’18 Release Exam




1. Which global variable can be used to detect whether a Visualforce page is loaded in Lightning apps with console navigation or standard navigation?
A)  $Browser.formFactor.
B)  $UI.UserTheme.
C)  $Organization.UITheme.
D)  $User.UITheme.

Answer: D.  $User.UITheme.



2. Which Salesforce command line interface (CLI) command supports the generation of new Apex triggers?

A)  force:schema:sobject: -t | createtrigger
B)  force:data:sobject:createtrigger
C)  force:trigger:new
D)  force:apex:trigger:create


Answer: D.  force:apex:trigger:create


3. Which debug type captures information related to accessing external objects with the Salesforce Connect cross-org and OData adapters?

A)  XDS_CONNECT.
B)  XDS_RESPONSE.
C)  XDS_OBJECT.
D)  XDS_REQUEST.
Answer: B. XDS_RESPONSE.

4.  What is the replacement that Salesforce recommends for Force.com IDE 2 Beta?
A)  Workbench.
B)  Developer Console.
C)  MavensMate for Sublime Text.
D)  Salesforce Extensions for VS code.

Answer: D.  Salesforce Extensions for VS code.


5. What can be used to control the styling and behavior of the Salesforce login process?

A)  Visaulforce page login flow.
B)  Lightning Component Login flow.
C)  Process Builder on login event.
D)  Quick Action on login event.

Answer: A.  Visaulforce page login flow.

Salesforce Certified Administrator Spring ’18 Release Exam Q & A




1. What are the path steps based upon when creating a campaign path?

A.Business processes
B.Picklist field values
C.Lead record types
D.Campaign responses

Answer: B. Picklist field values



2. The Administrator for Universal Containers is asked to provide the Sales teams with Opportunity Splits so that the opportunity owner has better visibility into their share of the deal. Which funtionality is available with Opportunity Splits?
A.Create a new Opportunity Split directly from the account record.
B.Send Opportunity Split notifications automatically.
C.Assign a dedicated opportunity owner to the split.
D.Add or adjust splits from the Opportunity Splits related list.

Answer: D. Add or adjust splits from the Opportunity Splits related list.


3. What must the administrator consider when enabling Themes?
A.Only one theme can be active at a time and is applied to the entire org.
B.Chatter External Users also see the custom theme.
C.Any user can select a theme and avatar based on their role.
D.There is no built-in theme if a custom theme is not created.

Answer: A. Only one theme can be active at a time and is applied to the entire org.


4. Which three features are available with Salesforce Files?
Choose 3 answers
A.Access files with the view list of assets feature.
B.Automatically upload .pdf files from an email attachment.
C.Allow Standard Users to create and delete content assets.
D.Integrate Quip to chat and collaborate on Files.
E.Create Asset Files for Unauthenticated users.

Answer: A,D,E


5. Which functionality is available to a support agent directly from the case feed?
A.Configure an email template
B.Reply and forward an email
C.Mass email
D.Delete an email

Answer: B.Reply and forward an email


6. Which three functions are available with chart enhancements in Lightning Experience?
Choose 3 answers
A.Combine small groups into “Others” on any chart.
B.Set chart legend position.
C.Show total in the center of donut charts.
D.Download chart images from dashboard components.
E.Display up to 2,000 groups in line and bar charts in dashboards.

Answer: B,C,D

Salesforce Certified Platform App Builder - Spring '18 Release Exam


1. What is a new feature in Lightning Experience added to Reports and Dashboards in this release?

A) Joined Reports
B) Matrix Reports

C) Subscribe to Reports
D) Subscribe to Dashboard
E) Row limit filters on Dashboards
Answer: B. Matrix Reports

2. How can an App Builder add a Flow to the Action menu on a Lighting record page?
A) Using an Object-specific Action
B) Using a Global Action
C) Using a Lightning component
D) Using an Auto-launched Flow
Answer: A. Using an Object-specific Action

3. Which new standard feature should an App Builder use to collect Sales team feedback about a new Lightning page layout?
A) Survey Lightning component
B) Survey Visualforce page
C) Survey Email Alert
D) Survey Quick Action
Answer: A. Survey Lightning component

4. Which data protection functionality does the Individual object provide?
A) Personal Information packaging
B) Personal Information deletion
C) Data Privacy Protection

D) Data Privacy Preferences
Answer: D. Data Privacy Preferences

5. Which object now triggers a Process Builder and Workflow Rule?
A) Orders
B) Topics

C) Campaigns
D) Assets
Answer: B. Topics





Thursday, 14 December 2017

Password field on Visualforce Page In Salesforce


VF TAG :


<apex:inputSecret value="{!PasswordValue}" id="PasswordValue"/>



VF Page :


<apex:page controller="contClass">
    <apex:form >
       Password : <apex:inputSecret value="{!PasswordValue}" id="PasswordValue"/>
    </apex:form>
</apex:page>


Output Screen :



How to Get parent records which has No(Zero) child Using SOQL In Salesforce


SOQL Explanation :




SELECT Id FROM Account WHERE Id NOT IN (SELECT AccountId FROM Contact)

Get N Character from a string using JAVASCRIPT


Use of CharAt(N)


var TestStr = '12345678';
String s = TestStr.charAt(3); 

//As index Start From 0 It Will Return 4

System.assertEquals()


System.assertEquals()


Public class AssertDemo {
    
    public void NewContact(String LastNameStr, String EmailStr) {
        Contact ConInstance = new Contact(LastName = LastnameStr,Email = EmailStr);
        Insert ConInstance;
        System.assertEquals('SFDCDOTCOM',ConInstance.LastName);
    }
}


 //the lastname of the Contact should be 'SFDCDOTCOM'. If we give the lastname
 // other than 'SFDCDOTCOM', it will throw error.

2FA For Community User In Salesforce (Two Factor Authentication )


Follow below Points Step by Step


1.      From Setup, enter Profiles in the Quick Find box, then select Profiles.





2.    Select a profile. In our case select “Portal_Super_User” profile.


3.   Click on Profile “Portal_Super_User”. Scroll to Session Settings and click on it



4: Click edit and For Session security level required at login, select High Assurance.

5. Click Save.

6: From Setup, enter Session Settings in the Quick Find box, then select Session Settings.



7: You will redirect to below page after clicking Session Setting.



8:  In Session Security Levels, scroll down and make sure that Two-Factor Authentication is in the High Assurance column.

If Two-Factor Authentication is in the Standard column, users get an error when they log in with a method that grants standard-level security.



9: Now try login into community using below URL. (URL may change based on your org.)


10 : You will redirect to below page.



11 :  Insert Username and Password and click login. 


12 : If this is your first time after 2FA enabled for user, you will redirect to below screen and it will
ask you to install the Salesforce Authenticator into your mobile.

You can download Salesforce Authenticator from Play Store.




13 :Once you download the Salesforce Authenticator click on “Add Account” to link your app
      with a salesforce org. You will get a two-word phrase.





14 :  Insert that Two-word phrase in below screen.







15.On connecting you will get notification with details of the user asking you to either “Approve” or “Deny” the login trial.





16: Now every time you will try logging into community you will get below screens asking you to either       “Approve” or “Deny” the login trial.





17 .Finish.