A Tip A Day #11 – Workaround for PriceBookEntry Trigger/Workflow

This post is a part of the daily blog series  A Tip A Day, daily dosage of learning! Day #9 - Workaround for PricebookEntry Trigger Salesforce has quite a few limitations on Product, Pricebook and Pricebookentry objects. The one that I recently faced on Pricebookentry is that we are not allowed to write triggers on Pricebookentry …

Advertisements

A Tip A Day #10 – ISCLONE in Trigger

This post is a part of the daily blog series  A Tip A Day, daily dosage of learning! Day #10 - ISCLONE in Trigger Triggers work on events like Insert, Update, Delete, Undelete.  There are requirements where you need to perform actions on Cloning of records too.  Salesforce has the default method that checks whether …

A Tip A Day #8 – Display Line Breaks of Long Text Area in VF Page

This post is a part of the daily blog series  A Tip A Day, daily dosage of learning!  Day #8 - Display Line Breaks of Long Text Area in Visualforce page. I have a field of type long text area called "Description" in Products object.  The value of this is generally a couple of paragraphs or …

A Tip A Day #7 – US Phone Validation Using RegEx

This post is a part of the daily blog series  A Tip A Day, daily dosage of learning!  Day #7 - US Phone Validation Using RegEx (Regular Expression) US Phone Number :  222-333-4444 String phone = '222-333-4444'; String WrongPhone = '222-333' //This is the pattern that matches with the above phone number format String regExPhone …

A Tip A Day #2 – Display custom popup message while Submitting for Approval

This post is a part of the daily blog series  A Tip A Day, daily dosage of learning!  Day #2 - Display custom popup message while Submitting for Approval Standard Approval Process Feature: When you setup Standard Approval process on any object, a standard button 'Submit For Approval' will be added to the page layout of …

7 Ways to Lock a Record in Salesforce

In this blog post, I'd be discussing the different ways to lock a Salesforce record in UI.  By lock, I mean, the user shouldn't be able to edit the field values of the record.  I have identified 7 ways to lock a record using configuration and coding. There is a general requirement that the Business doesn't …

Salesforce Optimizer – Scan Your Org Customization

Salesforce has introduced Optimizer to evaluate your Salesforce org implementation which determines how your company uses "certain" Salesforce features, then identifies ways that you can improve.  This is available for free for everyone. You can run Optimizer in sandbox/production to receive recommendations to: Improve features Clean up customizations Reduce complexity and Drive feature adoption. Features Evaluated …

Bulk Scheduling Dashboard Refresh using Apex Batch

Good stuff from Cloudy Affair!

cloudy ☁ affair

One fine day, I was browsing through the questions on Answers Community. A gentleman posted that his organization had over 150 dashboards which need to be refreshed simultaneously at a particular time of the day and currently they are doing it manually, which I understood was a tremendous overhead. I thought for a while and started posting an answer pointing towards whats stopping him to schedule a dashboard refresh. But then I thought maybe I should check the documentation and what I found was –

  • “Run Reports” & “Schedule Dashboards” permissions is necessary to refresh dashboard and schedule dashboard refresh respectively. [AB : Ok, thats fine.]
  • Unlimited and Performance Edition users can schedule up to two dashboard refreshes an hour per day. Enterprise Edition users can schedule up to one dashboard refresh an hour per day. [AB : Wooh, Whatttt!]
  • Additional scheduled dashboards may be available for purchase.  [AB : Makes sense, performance…

View original post 825 more words

Salesforce Code Scanner – Health Check

As a Salesforce Developer, have you ever worried about the code in your Salesforce org and wanted to check if: the code you have written/existing code is in line with the best practices? you have followed the coding guidelines suggested by Salesforce? there are any loop holes in the code that could cause severe security …

Visualforce Pagination with Dynamic Search

This post has a working example of dynamic search in a Visualforce page and the results shown with pagination. There are 4 field search criteria including date fields too which makes it more interesting.  The results upon clicking Search will display below the Search section with 4 buttons to paginate.  The Next/Last Page buttons grey …

Quick Tip – Change Date format in Apex

If you use any date fields in Apex, it prints in this format System.debug('Date: '+contact.Date); Output:  2016-04-26 00:00:00 To change the format you can simply use: format() System.debug('Date: '+contact.Date.format()); Output:  26/04/2016  

Run Script After Sandbox Creation and Refresh

This feature is to make your sandbox environment business ready, automate data manipulation or business logic tasks. At sandbox creation, specify a single Apex class to perform the tasks. This class executes every time the sandbox is refreshed/copied. Create an Apex class that implements SandboxPostCopy and specify the class here. For example, the following Apex class simply reports the three contexts …

Wrapper Class Multiple Value Sorting

Came across a scenario where I had to sort a wrapper class.  Normal list sorting is simple, list.sort(); would help.  But for a wrapper class, it's not straight-forward but it isn't that hard.  Below is a simple wrapper class without sorting - this wrapper has 2 columns : Area and AD. global class AreaWrapper{ public String …