Salesforce deployment with active scheduled jobs

An option has been added to the Deployment Settings page that lets you deploy components referenced by active Apex jobs. With this option, you don’t have to cancel Apex jobs to be able to have a successful deployment.

Previously, deployments failed if they contained components that were referenced by Apex jobs that were pending or in progress. For example, if you deploy an Apex class that implements Schedulable, and there is a scheduled job that corresponds to this class, this class can’t be deployed, and the entire deployment fails.

You can now enable the deployment of components with corresponding jobs—including scheduled jobs, batch jobs, and future methods—and avoid deployment failure. To do so, from Setup click Deployment Settings | Allow deployments of components when corresponding Apex jobs are pending or in progress, and then click Save.

As part of this change, the Deployment Connections page has been renamed to Deployment Settings.

This option applies to change sets and deployments started through the Metadata API.

  • Enabling this option might cause Apex jobs to fail due to unsupported changes.
  • This option doesn’t affect editing and saving Apex code in the Salesforce user interface (in Setup or theDeveloper Console), which will fail if there are active jobs associated with the Apex class. Updating Apex code by using the Force.com IDE can succeed if this option is enabled because Metadata API is used for the code update.

Some useful Mavensmate plugins

I’ve been using Mavensmate for over two years now and haven’t looked back. I think what initially grabbed me were the speed benefits when saving files to a connected Salesforce org. Eclipse in comparison seemed to hang for ages when doing this and you were prevented from working on anything else in the IDE while waiting. I’m pretty sure I’ve saved a heap of time making the switch.

One thing that I did miss natively available in Eclipse was the ability to look at and compare local file history. This often proved to be a life saver helping me out in tricky situations where I had maybe accidentally refreshed my local project with files from the server and overwritten files I was working on. These type of issues often arise when you also have multiple developers working in a single sandbox.

eclipse-local-history-compare

What I loved in Eclipse was basically that I always had a local backup of my files and the revision history for every time I have hit save on a file. Now you could say that I should commit my files to git more often, but I’m a bit fan of a clean git history, less = more in this case. If I’m working on a story, ideally I’d like to see one commit, and if I commit more than once I’m quite like to “squash” those commits into a single commit.

Here to the rescue comes local-history developed by Vishal Rana. Vishal summaries its key benefits:

  • Every time you modify a file, a copy of the old contents is kept in the local history.
  • At any time, you can compare a file with any older version from the history.
  • View incremental diff of any file from the history.
  • It can help you out when you change or delete a file by accident.
  • The history can also help you out when your workspace has a catastrophic problem or if you get disk errors that corrupt your workspace files.
  • Each file revision is stored in a separate file (with full path) inside the .sublime/history folder of your home directory. e.g., /Users/vrana/.sublime/history/foo/bar/Oct.14.2012_14.48.47.history.py

You can find the git repo here: https://github.com/vishr/local-history

The easiest way to install this plugins (and in fact all sublime text 3 plugins) is using package control.

  1. Go to https://packagecontrol.io/installation copy & paste the python code into the sublime console. You can get to the console in sublime by going to View > Show Console.
  2. Once you’ve installed package control you can install the local history plugin. Go to Sublime Text > Preferences > Package Control
  3. Package Control: Install Package and type the name of the package you wish to install; in this case type Local History.

package-controlpackage-control-install

package-control-local-history

I also recommend checking out another plugin which I’ve come across that merits a mention.
Bracket Highlighter seems to neatly highlight class and method opening and closing brackets.
I’ve installed the following tools which I find really useful.

https://github.com/facelessuser/BracketHighlighter (https://facelessuser.github.io/BracketHighlighter/installation/)

Let me know if you come any other plugins that you’ve found useful.

The difference between ISBLANK and ISNULL

ISBLANK has the same functionality as ISNULL, however ISBLANK also supports text fields. (Salesforce will continue to support ISNULL in any existing formulas).

  • A field is not empty if it contains a character, blank space, or zero. For example, a field that contains a space inserted with the spacebar is not empty.
  • Use the BLANKVALUE function to return a specified string if the field does not have a value; use the ISBLANK function if you only want to check if the field has a value.
  • If you use this function with a numeric field, the function only returns the specified string if the field does not have a value and is not configured to treat blank fields as zeroes.

I’m back…

T2

So I have just recently got back into developing my website. It’s been quite some time since I last touched it (2 years in fact) and I’ve decided that I would like to start blogging in order to consolidate my thoughts and ideas in one area and have the ability to refer back to them at a later date.

The first thing that struck me about using WordPress again is that I’m not in good shape when it comes to the development process; especially when tweaking with themes. I am making live changes using FileZilla. Now while this isn’t too much of a problem at the moment (I have very little web traffic) I know in the future this could prove to be a problem.

I heart kettlebells

KettleBell-Grant-177x300

Kettlebells have been around for a long time; in fact they were around in the 1700’s and used by Russian farmers to weigh crops. The farmers who used them quickly improved their strength, so much so that the Soviet Army took notice and got in on the act.

Now in the UK, they are gaining popularity, no doubt you have seen them scattered around on gym floors up and down the country. I first started using them on and off 2 years ago in an attempt to improve my base fitness and core strength. Ryan Shanahan has a programme called Kettleworx which is definitely worth checking out if you’re keen and fancy giving them a go.

How to pass the Salesforce.com DEV401 exam

salesforce

So, you’ve decided you want to have a stab at the DEV401 exam huh? …First of all let’s one thing straight; you can not blag the exam and expect to pass. Simply put, you’re going to have to put in the hard work and get yourself into a position where you are comfortable with using SFDC’s clickable interface and understand the key concepts behind it all. Nothing will ever beat jumping into a dev org and testing out the theory. It’s the only way you’ll fully understand what you’ve read… or about to read.

Useful DEV401 materials

  • Force.com Certified Developer Study Guide – this guide lists basic information about the exam, topics covered on the exam, percentage of questions that come from each topic, and some sample questions.
  • Force.com Fundamentals – sign up for a free Developer Force account and work through this PDF.
  • iTunes podcasts – I’d recommened dipping in and out of these podcasts as you see fit, particulary on more challenging topics. Beaware that these podcasts are now ageing and you might miss out on new functionality that is released in the future.

DEV401 exam details

The exam is made up of 60 multiple choice question and has a time limit of 90 minutes. This equates to 1.5 minutes per question. The general consensus is that the time limit is relatively generous and you shouldn’t worry about running out of time. If you know you’re stuff don’t be surprised if it only takes you half the allotted time.

If we look at the make up of the DEV401 course we can roughly gauge how many questions are going to be on each topic. The table below also acts as a good checklist for you. If you comfortably understand everything and can apply the concepts practically you should probably consider yourself to be in a good position to take the exam.

Objective Weighting
Application Design 0.05
List and describe components of an application
Describe the model-view-controller design paradigm
given a scenario, determine whether sufficient information is available to plan/build/design an application
Overview of Force.com Platform 0.05
List and describe the steps required to design and deploy a successful application built using the declarative capabilities of the force.com platform
List and describe the building blocks of an application provided by the force.com platform
Data Model 0.32
Describe how to create a functional data model for a business application
given a scenario, select the features required to create a functional data model for a business application
Describe the properties and implications of choosing one object relationship type over another and distinguish among relationship types
given a scenario, distinguish among object relationship types, describe how to create relationships, and determine which relationship should be recommended
List and describe the features used to set permission and data access in a custom app
given a scenario, select the appropriate feature (e.g., profiles, defaults, roles) to provide appropriate permissions and data access in a custom app
List and describe optional (Salesforce-enabled) features for managing the application (e.g., create audit fields, encrypted fields, multicurrency)
User Interface 0.15
List and describe the components of any force.com application user interface (e.g., tabs, applications, detail pages, list views)
given a scenario, determine the capabilities and constraints of the declarative framework for building a user interface (e.g., what can and can�t be done in a page layout)
Describe use cases for how force.com pages can extend the user interface in the declarative framework and when to do so
Describe the capabilities and functionality of force.com sites
Business Logic 0.23
List and describe how to create formulas, validation rules, and workflow rules
given a scenario, determine which force.com feature to use to solve a business requirement and/or describe how to apply the solution
List and describe the capabilities of the force.com approval processes
given a scenario, select the appropriate features of force.com approval processes to satisfy business requirements
List and describe the features of the force.com platform for debugging and monitoring automated business processes
Describe use cases for extending business logic through force.com code
Data Management 0.1
List and describe the capabilities and constraints of import wizards
List and describe the capabilities and constraints of aPi-based tools for managing data
List and describe the functions of the force.com Data Loader
Describe use cases and functions of external iDs and upsert
given a scenario, determine appropriate uses of the gUi and command-line interface for the data loader
Describe the characteristics of force.com record iDs
Reporting and Analytics 0.1
List and describe capabilities and constraints of reports and analytics of the force.com platform
given a scenario, determine methods for analyzing and displaying data

Index

Workflow and Approval processes.

Key technologies behind the Salesforce platform

  • Multi-tentant architecture – all users and apps share a single, common infrastructure and code base.
  • Metadata-driven development model – allows apps to defined as declarative ‘blueprints’ with no code required. Data models, objects, forms, workflows and more are defined by metadata.
  • API Access – provide direct access to all data in Force.com from virtually any programming language/platform. Web services API, REST API. RESTful Bulk API (also available using Data Loader) for operations on large numbers of records.
  • Apex – on-demand programming language which runs in the cloud.
  • VisualForce – a framework for creating feature-rich user interfaces for apps in the cloud.
  • Salesforce Mobile – an application for mobile devices that provides access to your Force.com data.
  • Sites – public websites/applications that are directly integrated with your Salesforce organisation – without requiring users to log in.
  • AppExchange directory – a web directory of Force.com apps.

Multi-tentant architecture

  • all users share the same physical instance and version of any application that runs on it.
  • all upgrades happen at once (no worry buying and maintaining physical stack of hardware and software)
  • apps can be low cost and quick to deploy.

Metadata-driven development model

  • helps app developers to be more productive – work at a higher level of abstraction, less worried about low level details however can leverage advanced features that the platform provides by default.
  • basic functionality of an app (tabs, forms and links) are defined in the metadata in a database rather than being hardcoded in a programming language.
  • when user accesses the app through the Force.com platform, it renders the app’s metadata into the interface the user experiences.

Web Services API

  • the ability to modify data in the app using third party services to create more customised app behaviours.

Visualforce

  • framework for creating interfaces which can extend the standard Force.com platform look and feel or replace it with a completely unique style.
  • Can use VF tags alongside HTML.

Sites

  • a way of sharing data and functionality in your apps with people outside of your organisation.
  • enable you to create public websites/applications integrated with your Salesforce organsation (without requiring a log in).

MVC model

Overview of Force.com Platform

Custom Objects

  • native components in app that model the data
  • similar to a database table
  • objects can be displayed as tabs – when tab is clicked user can see instances of that object
  • object can have relationships

Security and Sharing rules

  • ability to restrict access to data that particular users shouldn’t see.
  • object – what users should be allowed to create, view or edit.
  • which instances of that object should be accessible
  • wide brush security – object level security
  • more detailed brush – record level security

Workflow and Approval Processes

  • automating business processes e.g. triggering an alert email to a recruiter whenever a job application’s status has changed, and submitting new job openings for executive approval.
  • allow us to create business logic based on rules.
  • workflow rules – assign tasks to users, update fieilds or send email alerts.
  • approval processes – allow users to submit sensitive records like new contracts or purchase orders to other users for approval.

Custom Reports and Dashboards

  • Using report builder – create detailed reports with filters, conditional highlighting, subtotals and charts.
  • Using dashboard builder – quickly create a dashboard of up to 20 different components on a single page.

What field types can you create?

  • Auto Number – A system-generated sequence number that uses a display format you define. The number is automatically incremented for each new record.
  • Formula – A read-only field that derives its value from a formula expression you define. The formula field is updated when any of the source fields change.
  • Roll-Up Summary – A read-only field that displays the sum, minimum, or maximum value of a field in a related list or the record count of all records listed in a related list.
  • Lookup Relationship – Creates a relationship that links this object to another object. The relationship field allows users to click on a lookup icon to select a value from a popup list. The other object is the source of the values in the list.
  • Master-Detail Relationship – Creates a special type of parent-child relationship between this object (the child, or “detail”) and another object (the parent, or “master”) where:
    The relationship field is required on all detail records.
    Once the value of the relationship field has been saved, it cannot be changed.
    The ownership and sharing of a detail record are determined by the master record.
    When a user deletes the master record, all detail records are deleted.
    You can create rollup summary fields on the master record to summarize the detail records.
    The relationship field allows users to click on a lookup icon to select a value from a popup list. The master object is the source of the values in the list.
  • Checkbox – Allows users to select a True (checked) or False (unchecked) value.
  • Currency – Allows users to enter a dollar or other currency amount and automatically formats the field as a currency amount. This can be useful if you export data to Excel or another spreadsheet.
  • Date – Allows users to enter a date or pick a date from a popup calendar.
  • Date/Time – Allows users to enter a date and time, or pick a date from a popup calendar. When users click a date in the popup, that date and the current time are entered into the Date/Time field.
  • Email – Allows users to enter an email address, which is validated to ensure proper format. If this field is specified for a contact or lead, users can choose the address when clicking Send an Email. Note that custom email addresses cannot be used for mass emails.
  • Number – Allows users to enter any number. Leading zeros are removed.
  • Percent – Allows users to enter a percentage number, for example, ’10’ and automatically adds the percent sign to the number.
  • Phone – Allows users to enter any phone number. Automatically formats it as a phone number.
  • Picklist – Allows users to select a value from a list you define.
  • Picklist (Multi-Select) – Allows users to select multiple values from a list you define.
  • Text – Allows users to enter any combination of letters and numbers.
  • Text Area – Allows users to enter up to 255 characters on separate lines.
  • Text Area (Long) – Allows users to enter up to 32,768 characters on separate lines.
  • Text Area (Rich) – Allows users to enter formatted text, add images and links. Up to 32,768 characters on separate lines.
  • Text (Encrypted) – Allows users to enter any combination of letters and numbers and store them in encrypted form.
  • URL – Allows users to enter any valid website address. When users click on the field, the URL will open in a separate browser window.

Field dependancies

  • Filters that allow us to change the contents of a picklist based on the value of another field.
  • Controlling field – controls the available values in one or more corresponding dependent fields.
  • Dependent field – displays values based on the value selected in its corresponding controlling field.

An application is set of tabs.

You can have 3 types of tabs:

  • Custom object tab,
  • Web tab,
  • VisualForce tab.

A tab can organise objects and records, whereby each tab is associated with a unique object. When creating a tab you can specify the object and tab icon.

You can use Eclipse as a IDE for Salesforce using a plugin

A minimum of 75% test coverage must be achieved before you can deploy.

Workflow and Approval Processes

A queue

  • can hold a predefined set of objects and consists of a set of users.
  • Any of the queue members can pick up tasks assigned to the queue.
  • Users of Queues can be owners of records.

Approval processes

Salesforce supports easy to configure approval processes via a wizard interface.

  • Triggered when a user click on the “Submit for approval” button.
  • Process definition
    • Name of process
    • Entry criteria for records
    • Who is going to approve
    • Email template
    • Fields to be displayed in the approver page
    • Who is going to send approval mail
  • Intial submission actions
  • Step definitions
  • Final Rejection actions
  • Final Approval actions
  • Final Recall actions

Workflows

  • Workflow rules are like triggers
  • Action is triggered when a record meets an evaluation criteria
  • Workflow rules definition does not impact existing records
  • Workflow rule gets applied when a new record is created or edited

Workflow rules consists of 3 steps:

  • Select the object
  • Specify evaluation criteria i.e. when should the workflow rule be executed – e.g. when new records are created.
  • Define the rule criteria e.g. when status of job applicant is approved.

Workflow and Approval proceses actions:

  • Creating a task
  • Sending a message to an external system (outbound message) – helps keep SF coordinated with other applications
  • Updating a field value
  • Sending an email
  • Locking a record
Workflow Approval process
triggered when record is saved triggered when user clicks “Submit for Approval” button.
Single step and single action Multiple steps. Different action is taken depending on whether the record is approved or rejected.
Can be modified or deleted Some attributes can not be modified. Processes must be deactivated before approvals can be deleted.

Time based workflows

  • allows action to be triggererd after a delay e.g. in a recruting app if for a high priority position no candidates have been assigned, send an email to the recruiting manager.
  • can not be executed when evaluation is set to “Every time a record is created or updated

Approval processes

  • can be single or multiselect process
  • Multiselect processes require end user authorisation for record promotion
  • unique for object type

Parrallel Approval processes

  • allow upto 25 multiple approvers
  • the approver setting could be set to unanimous (all approvers must approve a request before considered approved) or first action

Dynamic Approval process

  • used to route approval requests to users listed in lookup fields on the record requiring approval
  • in this, approver names are defined dynamically from an object

Process Visualiser – provides Read-only visual of an Approval process. (a

Cycling to work…

0001055_halo_hex_skewers_0

I’ve decided to start cycling to work again seen as it a relatively short journey and simple to get there. As I am going to be locking my bike up outdoors more often I’ve changed all the quick release component back to their standard equivalents. Basically I am going under the premise that anything that isn’t locked down, will most certainly go ‘walkies’.

Halo hex wheel skewers

Using sprites in your websites

Over the past few months I’ve noticed a lot of the main stream websites such as Facebook.com and Amazon.co.uk using image sprites.

Basically a sprite is a 2D (could be 3D) image or animation that is combined to make a larger scene. Sprites were originally invented as a method of quickly compositing several images together in 2D video games.

Nowadays they’re used to reduce the number of HTTP connections made in downlading images or graphics. For example, lets say your website contains ten 1KB images. When someone accesses your site they will intially have to download all og these images, making 10 HTTP requests. This is fine and dandy for the average Joe’s website, but if we take a mainstream website such as Amazon with 1000’s of hits per day, the magnitute of these extra requests can dratically increase the load on the webserver.

By combining the 1KB files into one single file i.e. a sprite, you would only have to make one HTTP request to download the image. Using CSS you would then be able to specify which area of the sprite to use in your website.

Increase iphone battery life

Here’s are some quick tips to increasing the battery life on the iPhone.

calibrate-iphone-battery

Keep it cool, heat from sunlight can seriously degrade your battery life. Don’t take it to the extremes and put it in your freezer!
Keep your software updated – those boffins at Apple are always tinkering so that the hardware is used more efficiently.

Optimise your settings

Depending on how they are configured, a few features may decrease your iPhone battery life. For example, the frequency with which you retrieve email and the number of email accounts you auto-check can both affect battery life. The tips below apply to an iPhone running iPhone 3.0 or later software and may help extend your battery life.

Minimize use of location services – Applications that actively use location services such as Maps may reduce battery life. To disable location services, go to Settings > General > Location Services or use location services only when needed.
Turn off push notifications – Some applications from the App Store use the Apple Push Notification Service to alert you of new data. Those applications that extensively rely on push notifications (such as instant messaging applications) may impact battery life. To disable push notifications, go to Settings > Notifications and set Notifications to Off. Note that this does not prevent new data from being received when the application is opened. Also, the Notifications setting will not be visible if you do not have any applications installed that support push notifications.
Fetch new data less frequently – Applications such as Mail can be set to fetch data wirelessly at specific intervals. The more frequently email or other data is fetched, the quicker your battery may drain. To fetch new data manually, from the Home screen choose Settings > Mail, Contacts, Calendars > Fetch New Data and tap Manually. To increase the fetch interval, go to Settings > Mail, Contacts, Calendars > Fetch New Data and tap Hourly. Note that this is a global setting and applies to all applications that do not support push services.
Turn off push mail – If you have a push mail account such as Yahoo!, MobileMe or Microsoft Exchange, turn off push when you don’t need it. Go to Settings > Mail, Contacts, Calendars > Fetch New Data and set Push to Off. Messages sent to your push email accounts will now be received on your phone based on the global Fetch setting rather than as they arrive. If the global Fetch setting is set to Manually, you will not be able to locate your iPhone using the MobileMe Find My iPhone feature.
Auto-check fewer email accounts – You can save power by checking fewer email accounts. This can be accomplished by turning off an email account or by deleting it. To turn off an account, go to Settings > Mail, Contacts, Calendars, choose an email account, and set Account to Off. To remove an account, go to Settings > Mail, Contacts, Calendars, choose an email account, and tap Delete Account.
Minimize use of third-party applications – Excessive use of applications such as games that prevent the screen from dimming or shutting off or applications that use location services can reduce battery life.
Turn off Wi-Fi – If you rarely use Wi-Fi, you can turn it off to save power. Go to Settings > Wi-Fi and set Wi-Fi to Off. Note that if you frequently use your iPhone to browse the web, battery life may be improved by using Wi-Fi instead of cellular data networks.
Turn off Bluetooth – If you rarely use a Bluetooth headset or car kit, you can turn off Bluetooth to save power. Go to Settings > General > Bluetooth and set Bluetooth to Off.
Use Airplane Mode in low- or no-coverage areas – Because your iPhone always tries to maintain a connection with the cellular network, it may use more power in low- or no-coverage areas. Turning on Airplane Mode can increase battery life in these situations; however, you will be unable to make or receive calls. To turn on Airplane Mode, go to Settings and set Airplane Mode to On.
Adjust brightness – Dimming the screen is another way to extend battery life. Go to Settings > Brightness and drag the slider to the left to lower the default screen brightness. In addition, turning on Auto-Brightness allows the screen to adjust its brightness based on current lighting conditions. Go to Settings > Brightness and set Auto-Brightness to On.
Turn off EQ – Applying an equalizer setting to song playback on your iPhone can decrease battery life. To turn EQ off, go to Settings > iPod > EQ and tap Off. Note that if you’ve added EQ to songs directly in iTunes, you’ll need to set EQ on iPhone to Flat in order to have the same effect as Off because iPhone keeps your iTunes settings intact. Go to Settings > iPod > EQ and tap Flat.
Turn off 3G – Using 3G cellular networks loads data faster, but may also decrease battery life, especially in areas with limited 3G coverage. To disable 3G, from the Home screen choose Settings > General > Network and set Enable 3G to Off. You will still be able to make and receive calls and access cellular data networks via EDGE or GPRS where available.

Lock Your iPhone

It may seem obvious, but you should lock your iPhone when you aren’t using it. You will be able to receive calls and text messages while it is locked, but nothing happens if you touch the screen. To lock iPhone, press the Sleep/Wake button. You can also set the Auto-Lock interval so your iPhone will turn off more quickly after a period of inactivity. To set Auto-Lock, go to Settings > General > Auto-Lock and set the interval to a short time, such as 1 minute.

Use iPhone Regularly

For proper maintenance of a lithium-based battery, it’s important to keep the electrons in it moving occasionally. Be sure to go through at least one charge cycle per month (charging the battery to 100% and then completely running it down).