Tag Archives: Dipak Blog

Testing Future Methods in Test Class

To test methods defined with the future annotation, call the class containing the method in a startTest(), stopTest()code block. All asynchronous calls made after the startTest method are collected by the system. When stopTest is executed, all asynchronous processes are run synchronously. For our example, please take a look at below test class. Future Method …

Continue reading

How to log status of a completed Batch Job Status

While we are processing bulk records in a batch Apex, we may need to know the status or want to keep log of completed batch. For example – one batch job is scheduled at night 4.00 AM, and every day we need to track whether current job status, whether It was success or failure. One way …

Continue reading

Delete records from multiple objects via apex batch class

In order to delete record from multiple Objects in batch , we can go ahead with below possible options. Using Custom Iterator to process List of Ids from multiple Objects – For Details : https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_iterable.htm Re-run batch after processiong 9999 records – I will explain it in my next post Call batches in Chain –  On …

Continue reading

Switch from one Tab to another in apex:Tab panel

Here is the sample code using which we can do navigate between tabs present inside apex:tabpanel. VF Code: Apex Controller:

Continue reading

Some times, Why can’t we do inline editing in a List View?

I’ve got a custom object with a number of different record types. In the ListView I’m displaying a checkbox which I’d like to be able to check/uncheck inline since it would be so much quicker. I have enable the Inline Edit for my organisation ,unfortunately It was not working. I was not sure what else …

Continue reading

Visualforce page that renders as PDF ,when a button is pushed/clicked.

Some times we may need Visualforce page that renders as PDF ,when a button is pushed/clicked. There is few ways to do this Place a Button on VF page , then on action method of this button, redirect to a similar VF page having “renderAs=pdf”.(It is working) But why should we need similar VF with …

Continue reading

Colour of pageBlockSection title bar

Few months back, I have client requirement to change the color of pageBlockSection BAR depending upon a condition (If a field value is equal to someValue). Salesforce does not provide any standard feature or any direct method. So to achieve this functionality we have to override the CSS of Salesforce. Note: Do not rely on …

Continue reading

Roll-Up Summary Fields With Lookup Relationships

Roll Up Summary is a very common need in Salesforce Master-Detail Relationship. There are various types of RollUp Summary field i.e COUNT, SUM, AVG, MAX/MIN etc, There are few limitations on Roll-up Summary field Type Objects have a limit of 10 maximum roll-up summary fields Objects on the master side of a master-detail relationship can …

Continue reading

Email Services in Salesforce(Email To Object)

If you are looking for easiest option to create any Object record(lead/contact etc) using email, here I’m sharing the code to achieve this requirement. Ideally User would send an email to a predefined/prefixed email address, and it’d automatically create a record in Salesforce.com organisation. Steps: Step-1 Create a Email-Service To use email services, from Setup, …

Continue reading

Trigger on Lead Conversion Process in Salesforce

Today, there is a requirement from my client , to customize the LeadConversion process. Client’s need was to create a record at child object of Contact when Lead will be converted. So here I’d like to share few code to customize the lead Conversion process. when Lead will be converted , then a new reorcd …

Continue reading