ads

Friday, 17 August 2018

Check object level security within a Visualforce page


By using this " {!$ObjectType.Lead.Accessible} " to check object level security within a Visualforce page in Salesforce.

VF page Code Format:

<apex:page>

    {!$ObjectType.Lead.Accessible} 

</apex:page>

Visible required symbol in apex:inputText

Code Format:

VisualForce Page:

<apex:page controller="makeRequired">

    <apex:form >

        <apex:pageBlock >

                <apex:pageBlockSection >

                <apex:pageBlockSectionItem >

                   <apex:outputLabel value="Account Name"/>

                    <apex:outputPanel styleClass="requiredInput" layout="block" >

                    <apex:outputPanel styleClass="requiredBlock" layout="block"/>

                    <apex:inputText value="{!str}" required="true"/> 

                    </apex:outputpanel>

               </apex:pageBlockSectionItem>

                </apex:pageBlockSection>

        </apex:pageBlock>

    </apex:form>

</apex:page>


Apex Class:

public with sharing class makeRequired { 

    public String str {Get;set;}
    
    public makeRequired() {
    }    
 
}

Output:

Change the color in apex:panelBar.

Code Format:

<apex:page sidebar="True">
    <apex:panelBar style="background-color:Orange;" headerStyle="background-color:lightgreen;background-image:none;">
        <apex:panelBarItem label="Line 1">
            Line 1
        </apex:panelBarItem>
        <apex:panelBarItem label="Line 2">
            Line 2
        </apex:panelBarItem>
        <apex:panelBarItem label="Line 3">
            Line 3
        </apex:panelBarItem>
    </apex:panelBar>

</apex:page>

Output:



Thursday, 16 August 2018

Change the color in apex:toolBar

Code Format:


<apex:page sidebar="true">
    <apex:form >
        
           <apex:toolbar style="background-color:yellow;background-image:none;">
           <apex:inputText /> <n> </n>
           </apex:toolbar>

    </apex:form>
</apex:page>


Output:



Force.com setup in Visualforce page as Side Bar

Code Format:

<apex:page setup="true">

    www.sfdcforyou.com

</apex:page>


Output:



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: DData Privacy Preferences

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

C) Campaigns
D) Assets
Answer: B. Topics