How to hide drives in Windows

download

  • Go to run
  • Type “diskpart”.
  • Type “list volume”.
  • Now select the volume you want to hide by typing “select volume n” (n is the volume number against the drive you want to hide). eg: select volume 2.
  • Type “remove letter x”(x is the drive name). eg: remove letter D.
  • Done, now check my computer.
  • If you want to show the drive again then repeat step 1 to 4 then type “assign letter x”.

Note: Don’t try with drive C. If you have locked something with Folder lock or other software then after assigning the drive everything will be unlocked.

How to show more records in related list in Salesforce?

When viewing a record detail page (e.g. Contact detail) the related lists (e.g. Cases related list) shows a limited number of related records at a time.

download (1)

So, if you have more than 5 (by default) Cases tagged to an Contact, in the Contact detail page, you will see Show m more » | Go to list (n+) ». By default a will be 5 and b is total number of the records.

You can scroll down to the bottom of page, and look for Always show me more records per related list or Always show me fewer / more records per related list if you have click more before (even in previous login).
Always show me more records:

download (2)

Always show me fewer / more records:

download (3)

Clicking more or fewer increases and decreases the default number 5 (by default) of related list records displayed for all object record detail pages for the logged in user. If you notice, when you click more or fewer link, in the URL, Salesforce will add parameters rowsperlist=m (e.g. https://ap1.salesforce.com/0039000000ojedc?rowsperlist=10), this parameter will show related list up to 10 records for all related list.
Note: This change will be permanent for the logged in user for all tab, and can increase the related list records up-to 100.

Multiple email addresses for one gmail account

Let’s say that I have a gmail address: itzbiswajeet@gmail.com.

Now if I am signing up for a newsletter at ABC Corp. I can register with the email address itzbiswajeet+abc@gmail.com. You can put any extra alphanumeric character after the plus sign and it still gets delivered to itzbiswajeet@gmail.com.

One benefit of this feature is to track where emails are coming from.

Export Data In Excel Using Visualforce Page

Here in below example I have a VF Page “AccountDetails.vf” with parameter of account Id. In that VF Page I’m showing the Account record respective Contacts. And a button that export the Contact records to excel sheet. Another VF Page “ContactExportToExcel.vf” for excel.

Viualforce Page: AccountDetails.vf

<apex:page standardController="Account" extensions="ContactExportToExcel">
    <apex:form>
        <apex:pageBlock title="Hello {!$User.FirstName}!">
            You are viewing the {!account.name} account.
        </apex:pageBlock>
        <apex:pageBlock title="Contacts">
            <apex:pageBlockTable value="{!account.Contacts}" var="contact">
                <apex:column value="{!contact.Name}"/>
                <apex:column value="{!contact.Email}"/>
                <apex:column value="{!contact.Phone}"/>
            </apex:pageBlockTable>
        </apex:pageBlock>
        
        <apex:commandButton value="Export To Excel" Action="{!ExportToExcel}"/>  
    </apex:form>
</apex:page>

Remember to pass an Account ID as a query string to this page.

Controller:

public with sharing class ContactExportToExcel {
    
    Public List<String> selectedFieldsList {get;set;}
    Public List<Contact> conList {get;set;}
    
    public ContactExportToExcel(ApexPages.StandardController stdCtrl) {
        Account acc = (Account)stdCtrl.getRecord();
        conList = New List<Contact>();
        conList = [Select Id, Name, Email, Phone From Contact Where AccountId =: acc.Id];
    }
    
    Public PageReference ExportToExcel(){
        selectedFieldsList = New List<string>();
        selectedFieldsList.add('Name'); 
        selectedFieldsList.add('Email');
        selectedFieldsList.add('Phone');
        
        PageReference pgRef = New Pagereference('/apex'+'/ContactExportToExcel');
        pgRef.setRedirect(false); 
        return pgRef;
    }
    
}

Visualforce Page: ContactExportToExcel.vf

<apex:page standardController="Account" extensions="ContactExportToExcel" contentType="application/vnd.ms-excel#Contacts.xls" cache="true">
    <apex:pageBlock >
        <apex:pageblocktable value="{!conList }" var="tab">
            <apex:repeat value="{!selectedFieldsList}" var="field">
                <apex:column value="{!tab[field]}"/>
            </apex:repeat>
        </apex:pageblocktable>
    </apex:pageBlock>
</apex:page>

Output:

CSV Helper

Biswajeet   March 25, 2014   No Comments on CSV Helper

A .NET library for reading and writing CSV files. Extremely fast, flexible and easy to use. Supports reading and writing of custom class objects.

The first thing to do is to Install CsvHelper.
To install CsvHelper, run the following from the Package Manager Console.

Install-Package CsvHelper 

Now add CsvHelper to the program by adding:

using CsvHelper;

The next step is to create a class which has properties with the same name of the column headings found in the csv file.  Below you will find an example of a class which does this:

public class Customer
{
    public string Name { get; set; }
    public string Address { get; set; }
    public string PhoneNo { get; set; }
    public string Country { get; set; }
} 

Finally create an instance of CSVReader and invoke the GetRecords method using the DataRecord class. Below you will find an example of this:

using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using CsvHelper;
namespace CSVHelperReadSample
{
    internal class Program
    {
       private static void Main(string[] args)
       {
          using (var sr = new StreamReader(@"Customerlist.csv"))
          {
             var reader = new CsvReader(sr);

             //CSVReader will now read the whole file into an enumerable
             IEnumerable<datarecord> records = reader.GetRecords<customer>();

             //First 5 records in CSV file will be printed to the Output Window
             foreach (DataRecord record in records.Take(5))
             {
                 Debug.Print("{0} {1}, {2}, {3}", record.Name, record.Address, record.PhoneNo, record.Country);
             }
         }
      }
   }
}