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 …
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 …
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 …
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 …
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 …
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, …
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 …