LET'S LEARN TOGETHER. THE BEAUTIFUL THING ABOUT LEARNING IS NOBODY CAN TAKE IT AWAY FROM YOU.

Apex Debugger || All you need to know || Advanced Configuration

This post is in continuation of my previous post where I have explained the basic configuration of Apex Debugger. If you haven't gone through that, I would request you to please go here.

So with the assumption that you have configured Apex Debugger correctly and can do debugging, in this post, I will explain some advanced configurations which you can do with Apex Debugger.

So let's start -
  • Choose for which user you want to enable the Apex Debugger - You can choose the user for which you want to enable the Apex Debugger. For that open Debug Configuration. Then check the Whitelisting Enabled and Use SOQL where clause option. Then put the where clause. For example in the below screenshot, I have put the ID of the user and clicked on the Query button 
  • Choose the request type - With this option you can select the request type for which you want to enable the Apex Debugger. Currently we can enable Apex Debugger for the below options - Execute Anonymous, Inbound Email Service, Invocable Action, Lightning/Aura, Quick Action, REST, Run Tests Synchronous, SOAP, Synchronous, Visualforce, Visualforce Remote Method. If you don't choose anything, it means it is enabled for all the above types of requests.
  • Choose Entry Point - With this option, you can choose the entry point. For example if you want to enable Apex Debugger for particular Visualforce page, you can put .*/apex/DemoPage.apexp
Let's check out the above mentioned advanced configurations with one example.

Use case: Create a VisualForce page where accounts can be selected by lookup button. Once an account is selected, all the associated contacts will be displayed.
Implementation:
Here is the VisualForce Page -

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
<apex:page standardController="Contact" extensions="SudiptaDeb_ContactList_Demo" showheader="false">
<apex:form >
 <center>
  <br/><br/>
        <apex:outputLabel value="Account Name"> 
   <apex:inputField value="{!Contact.AccountId}" required="false" id="lid">
    <br/><br/><br/>
           <apex:actionsupport event="onchange" rerender="check"/>
         </apex:inputField>
        </apex:outputLabel>
        <apex:outputPanel id="check">
      <apex:outputLabel value="Contacts:" rendered="{!contact.AccountId!=null}">
           <apex:selectCheckboxes value="{!selectedAccount}">
              <apex:selectOptions value="{!items}"/>
          </apex:selectCheckboxes><br/>
         </apex:outputLabel>
        </apex:outputPanel>
 </center>
</apex:form>
</apex:page>
Here is the controller SudiptaDeb_ContactList_Demo

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
public with sharing class SudiptaDeb_ContactList_Demo {
 public contact selectedAccount{get;set;}
  public SudiptaDeb_ContactList_Demo(ApexPages.StandardController stdCtrl) {
  selectedAccount=(Contact)stdCtrl.getRecord();
  }
  public List<SelectOption> getItems(){
       List<Contact> cntList=[select Name from Contact
              where AccountId=:selectedAccount.AccountID];
       List<SelectOption> options = new List<SelectOption>();
        for (Contact c:cntList){
   options.add(new SelectOption(c.Name,c.Name));
        }
        return options;
 }
 }

Debugging:
Now what I will do here are mentioned below -
  • I will give my User ID in the Debug Configuration | Whitelisting Enabled section to make sure only my requests will be considered for Apex Debugging. With this option, if someone else is working in the same Sandbox, their requests will not be tracked here.
  • I will select VisualForce under request type because I am only interested to debug when the execution will trigger from VisualForce page. My intention is that I will do some activity in the VisualForce page and I would like to debug the Apex controller code.
Here is the screenshot of all the configurations -

Now in the controller, I will put breakpoints @ line # 4, 7 and 13. After that with Debugger session on, when I will select an account in the VF page, the execution will stop at the breakpoints. Below is the screenshot -

So now I can debug my controller by starting the execution from VisualForce page. With this example, I believe you will feel more comfortable to play with other supported request types. Go ahead. It's all yours. 

Lastly I would like to inform you about few limits and considerations.
Apex Debugger Limits -

Apex Debugger Considerations -
Click here

Please let me know your feedback. Thanks in advance. Happy Salesforce Debugging!!!
Share:

Apex Debugger || All you need to know || Basic Configuration

Finally, Salesforce brings Debugging feature. I was waiting for this one for a long time and I am quite sure that many other developers like me also waited for this one.

Today in this post, I would like to explain how you can use this feature and make your Salesforce developer life more powerful.

Before I start, I would like to mention that this feature is not available in Developer orgs, it is only available in Sandboxes. You need to contact Salesforce to enable this feature in your Sandboxes. There is cost involved in getting this one enabled. To know about the cost, please contact Salesforce.

With the assumptions that you have enabled this feature in your Sandbox, you need to setup your Sandbox as well as your Eclipse workplace. Below are the steps mentioned in Salesforce guide -

Setup Sandbox for Apex Debugger -
Setup Force.com IDE -
  1. First you need to Install or Update Force.com IDE plugin as instructed below -
  2. Once done, create a Salesforce project as instructed here. Note - Make sure you mark your Eclipse project as work online.
Setup Eclipse Debugger -
This is the most important step where you need to setup your Eclipse Debugger. To do that -


  1. Click on the Debug Icon in the toolbar and select Debug Configuration
  2. Select Remote Apex Debugger
  3. Click on the New Launch Configuration Icon
  4. Give some name of your configuration
  5. Click Browse and select your project
  6. Click Apply, and then Debug.
Once you are done with the above steps, your basis setup is done and you are ready to use Apex Debugger. So let's use now.

I have created one very basic Apex class to start with. The code is below -

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
public with sharing class SudiptaDeb_ApexDebug_Demo {
 public void method1(String str){
  method2(str);
 }   
 
 private void method2(String str){
  String strToBePassed = 'String from method1: ' + str;
  method3(strToBePassed);
 }
 
 private void method3(String str){
  String strToBeDisplayed = 'Final String: ' + str;
  System.Debug(strToBeDisplayed);
 }
}
Now let's follow the below steps to do the debugging -
  • Setup breakpoint @ line # 3, 7 and 12. Intention is that we will see the values of the variables during the execution flow. You can setup breakpoint by double clicking on the line numbers
  • Open the Debug perspective by choosing Window | Open Perspective | Other | Debug
  • Click on the Debug icon and launch the new debug configuration (created earlier) You will get yellow gear icon indicating that your debug session is ready. 
  • Let's execute the below code from Developer console's Execute Anonymous Window -         new SudiptaDeb_ApexDebug_Demo().method1('Sudipta Deb');
  • Once you start that you will see that in Eclipse the executing is waiting at your first breakpoint as shown below -
  • Watch the value of the variable as shown below - 
  • Click on Step Over icon you will see the execution is now moved to second breakpoint. Watch for the value now as shown below - 
  • Again click on Step Over icon you will see the execution is now moved to third breakpoint. Watch for the value now as shown below - 
If you are able to do the above steps and see the results, it means you have Apex Debugger setup correctly and you now have the power you need in your hand. 

Great!!! In my next post, I have explained some of the more advanced features of Apex Debugger. Till then, feel free to post your comments and let me know how you feel about this great feature from Salesforce. Have a nice day. 
Share:

Summer'16 New Feature || Create your own calendar from any object


Salesforce Summer'16 release is a milestone release for Salesforce as it is their 50th release. But apart from being the 50th release, there are many reasons for considering this release as the milestone release. In this release, Salesforce brings some of the really key features which are really awesome.

In this post, I am going to discuss about the new feature called - Creating Calendar from anything in Salesforce.

Really!! Yes, as the name suggests now you can create a calendar from any object in Salesforce. As long as you have some date fields present in the custom object, you can create calendar from that object. This feature is available in Lightning Experience only and available in Enterprise, Unlimited and Developer edition.

But to understand why we need calendar let's give you an example. Say you are working with opportunities. So from the list view - "All Opportunities", you can get the details about the closing date of the opportunities. But it's still in the list view showing the details in rows. But think if you can get a visual calendar representation of the same information, it will have more powerful impact as well as give you the information more quickly. From the calendar, you can easily identify which opportunities are closing this day, or this week, or this month. So yes, this is really a cool feature introduces by Salesforce.

So without any further delay, let's discuss about different options available while creating the calendar with some example. Follow the below steps to create calendar (in this example, I am creating calendar from Opportunity object showing the closing date of the opportunities).  

Step 1:
Once you are in Lightning Home Page, go to Calendar from Navigation Panel

Step 2:
Click on New Calendar Option as displayed below in the screenshot.
Step 3:
This is place where you can select the object for which you want to create the Calendar. So for our example, let's select Opportunity object and click next.
Step 4:
Now below screen is the most important one. Here you can select -
  • Calendar Name:  Very much self explanatory, the name of your calendar.
  • Field for Start:  This field will decide where to put the entry of your record in the calendar. Here you can choose either Date type or Date/Time type field. If you choose Date type field, calendar entry will show full day event whereas if you choose Date/Time type field, calendar entry will be exactly on the same date and same time.
  • Field for End: This is an optional field. This will decide how long the calendar entry should be like calendar entry end time. Here you have to select same type of field i.e. either Date or Date/Time type which you have selected in Field for Start.
  • Apply a Filter: This will decide your calendar will work on which list views. You can select available list views from the object.
  • Field Name to Display: This will decide what will be displayed in the calendar entry.
So for our example where we want to display Opportunity closing information in the Calendar, choose the below values as shown in the below screenshot -


We are done. Our calendar is ready. Let's see how it looks now -

Note - The color of your calendar will be same as configured in the object.

So now what do you think? Don't you think it is a great feature. 

There are few considerations while creating calendar also, but I would like to highlight one consideration here which is the limit of 150 calendar entry in day or week view including all your calendars and Salesforce events. If you have more than 150 calendar entries in the selected calendar, Salesforce Lightning system will show you an alert message and hides entries from other calendar.
 You can go through the other considerations here -
https://help.salesforce.com/apex/HTViewHelpDoc?id=calendar_create_limitations.htm&&language=en_US

I request you to try this out in your developer org. Please provide your comments. Thanks.
Share:

Follow Me

Enter your email address:

Delivered by FeedBurner

Popular Posts

Labels

Salesforce (105) Apex (45) admin (27) visualforce (21) ADM (20) dev 501 (19) integration (18) learn salesforce (18) 501 (16) SOAP (13) lightning (12) tutorial (11) Certification. (9) javascript (9) Certification (7) Trigger (7) test class (7) unit testing (7) Advanced Admin (6) Sharing and Visibility (6) design pattern (6) developer (6) report (6) salesforce release (6) security (6) trailhead (6) Advanced Apex (5) Kitchener Developer Group (5) New Features (5) SOQL (5) css (5) dashboard (5) debug (5) formula (5) mobile (5) service cloud (5) solution management (5) use case (5) JSON (4) Lightning Experience (4) Salesforce DX (4) WebSphere (4) best practice (4) cast iron (4) component (4) deployment (4) github (4) html (4) polymer (4) profiles (4) responsive (4) tdd (4) ui (4) Architect (3) Live Chat (3) Online Event (3) Opportunity (3) Performance (3) Products (3) REST (3) Role (3) Sales Cloud (3) Scratch Org (3) Study Notes. (3) Summer15 (3) Tips (3) Web Technology (3) dynamic apex (3) event (3) license (3) map (3) mapbox (3) singleton (3) version controlling (3) Asynchronous callout (2) Bulkify (2) Data Architecture and Management Certification (2) Devops (2) Distributed Version Controlling (2) ES6 (2) Eclipse (2) Einstein (2) Enterprise Territory Management (2) Financial Services Cloud (2) Force.com IDE (2) Governor Limit (2) Groups (2) IBM (2) Implicit Sharing (2) JourneyToCTA (2) Kitchener User Group (2) Lightning Design System (2) Live Agent (2) Metadata (2) PD II (2) Price Book (2) SOSL (2) Sharing (2) Spring 15 (2) Summer17 (2) Territory (2) ant (2) automation tool (2) basic (2) chatter (2) coding (2) communication (2) console (2) controller (2) documentation (2) flow (2) git (2) jquery (2) logging (2) object (2) permission (2) process builder (2) release (2) salesforce1 (2) strategy (2) xml (2) Action Plan (1) Action Plan Template (1) Advanced Currency (1) Agent Productivity (1) Analytics (1) Apex Sharing (1) Arrow (1) Asynchronous Apex (1) Aura Framework (1) Batch (1) Bots (1) Browser (1) Bulk data load (1) CTA (1) Calendar (1) Canon (1) Case Management (1) Celebration (1) Cheat Sheet (1) Classic (1) Community (1) Confetti (1) Constructor (1) Contact Center (1) Continuation (1) Continuous Integration (1) Convert (1) Cookie (1) Custom Metadata (1) Custom Object (1) Customer (1) Dated Exchange Rate (1) Decorator Design Pattern (1) Dev Hub (1) Diwali (1) Email (1) FSC (1) Function (1) Future (1) Goals (1) Guide (1) Household (1) Ideas (1) Improvement (1) KPIs (1) Large Data Volume (1) LastModifiedDate (1) Lightning Web Component (1) Manage Currencies (1) Manual Sharing (1) Metrics (1) Multi Currency (1) New (1) New Feature (1) OOPS (1) OWD (1) Omni-Channel (1) Partner (1) Person Account (1) Photo (1) Pipeline (1) Platform Developer I (1) Platform Developer II (1) Presentation (1) Product Schedule (1) Profile (1) Promise (1) Prototype (1) Public Site (1) Query Plan (1) Queueable (1) QuickReference (1) Reports (1) Retrieve (1) Role Hierarchy (1) SFDX (1) Salesforce Optimizer (1) Schedule (1) Session (1) Sharing Rule (1) Sharing Sets (1) Site (1) Skills (1) Snap-ins (1) Spring 17 (1) Summer14 (1) Summer16 (1) Summer19 (1) Switch (1) SystemModStamp (1) User License (1) Users (1) Webservice (1) Winter'15 (1) Winter'17 (1) access (1) actionFunction (1) actionPoller (1) actionRegion (1) actionSupport (1) agile (1) app (1) approval process (1) aura (1) awesome (1) backup (1) bitbucket (1) book (1) campaign (1) change set (1) code (1) code coverage (1) configuration (1) csv (1) custom button (1) custom settings (1) customization (1) data loader (1) database (1) delegate Admin (1) describe (1) dom (1) dreamforce (1) duplicate (1) dynamic (1) equals (1) error (1) field-level security (1) folder (1) ftp (1) generic (1) gift (1) global describe (1) hashcode (1) import wizard (1) jenkins (1) keynote (1) long running requests (1) monitoring (1) mysql (1) page layout (1) personal (1) power of one (1) record type (1) relationship (1) request (1) review (1) sub-tab (1) tab (1) username (1) visual workflow (1) workflow (1)

Total Subscribers

Total Pageviews