2. Who are we – Paul Mooney
2#engageug
• Senior Architect, Bluewave Technology
• Did a lot of Domino Admin stuff
• For 15 years or so
• Certified Salesforce
• Administrator
• Advanced Administrator
• Developer (Yes – I know… mental)
• Service Cloud Consultant
• Sales Cloud Consultant
• Instructor
• Spoke at a lot of things over the years
• Mostly sober
3. Who are we – Mark Myers
• Member of the London Developer Co-op
• Co-writer of LDCVia
http://www.ldcvia.com
• IBM Connections, Domino,
Salesforce and Web development
• Hire me!
• Developer from a support background
• 14+ years on Domino, 17+ years in IT
• Speaker at 6 x Lotuspheres/Connects, 6 x
UKLUGs, 1 x ILUG (A very drunk one), 4
x BLUG/Engage
3#engageug
4. What’s this session about?
“All software sucks”
-Paul Mooney, 2014
“Some of the time”
-Mark Myers, 2014
4#engageug
7. • 16 years old
• 180,000 customers
• 2.8 million users
• Forbes most innovative company 2011, 2012, 2013, 2014,
2015
• New release for all customers three times a year
7#engageug
8. • 17 Languages
natively supported
• Global translation capability for content and custom application
design
• Fully accredited Safe Harbour Trust for EU
• ISO27001 compliance certified
• Staff doubled in past year (8000 employees)
8#engageug
13. It’s not a mail server
(It does fully integrate with Outlook, O365, Google Apps, Lotus
Notes etc)
13#engageug
An administrator is not an administrator
There are no servers – Administrators ontop of managing/
integrating tend to Declaratively (click) develop)
18. More on objects, fields
18#engageug
• Standard objects – fully functional pre built tables
• Can be completely customised/altered as needed
• You ALWAYS alter them
• You cannot delete them, but do not have to use them
• Standard fields – built for you in standard objects
• Can be altered to a point
• You cannot delete them, but you can hide them
• Custom Objects – create your own tables / apps
• Custom fields – create your own fields
• End in __c. 400 fields per object limit
22. Types of fields in Salesforce
• Auto Number
• Formula
• Roll Up
• Lookup
• Master Detail
• External Lookup
• Checkbox
• Currency
• Date
22#engageug
• Date/Time
• Email
• Geolocation
• Number
• Percent
• Phone
• Picklist
• Multi value
Picklist
• Text
• Text Area
• Text Area (Long)
• Text Area (rich)
• Encrypted
• URL
27. Similar problems that can be solved
• Poor design possible
• Poor release management
• Too many rights (changing
stuff in production)
27#engageug
• Poor design possible
• Poor release management
• Too many rights (changing
stuff in production)
28. Salesforce Development Consists of 2 Types
28#engageug
• Declarative (Point-And-Click)
• Simple.
• Fast.
• Easy.
• Upgrades don't break your apps.
• Does not require programming skills.
• Programmatic (Apex / Visualforce / API)
• Finer Control.
• Flexibility.
• You can expand capabilities to match User demands.
29. How Salesforce Dev is the same as Domino Dev
• Due to fast version iterations Salesforce is about the same
age as Domino feature wise so it is full of poorly
documented quirks and artefacts.
• User behaviour is like the golden days of Notes Dev, your
users will add fields and bits into the live design meaning
your dev environment is out of date.
• New Design elements keep being created as the “next big
thing”
29#engageug
30. How Salesforce Dev differs from Domino Dev
• Online only (though you can have sandboxes).
• Clever hacks to provide users with what they want are
NOT supported by Salesforce.
• “we do not support javascript”
• Never sure how much of your existing code each new
version of Salesforce will break.
• (Paul Edit. This was Mark’s fault)
30#engageug
31. The are 5 Golden Rules to
Salesforce development
31#engageug
32. Golden Rules
1) Salesforce Cares more about their platform than your code.
2) Salesforce Cares more about their platform than your code.
3) Salesforce Cares more about their platform than your code.
4) Salesforce Cares more about their platform than your code.
5) Salesforce Cares more about their platform than your code.
32#engageug
33. Golden Rules
1) Think of all database actions in terms of Batches.
2) Crude code scales VERY poorly and hits hard
salesforce limits.
3) Salesforce feels like a Document based system, but
under the covers it’s a classic Relational database
system.
4) Write your tests at the same time as your code, its
quicker that way.
5) Keep up to date with what the platform is doing (not
doing so costs you money and makes you look silly)
33#engageug
34. Batches – BAD!
• In Notes you tend to
write to disk on every
iteration on a document
loop
• In Salesforce this will fail
validation when you
attempt to promote to
live
34#engageug
for(Integer i=0; i<25; i++) {
Case ct = new Case(
Priority = '1 - Critical',
Status = 'Logged',
Resoloution_Sub_Category__c = '');
insert ct;
}
35. Batches – GOOD!
• Save up all your
transaction and at
the end of the Loop
write them to the
database.
35#engageug
List<Case> cases = new List<Case>();
for(Integer i=0; i<25; i++) {
Case ct = new Case(
Priority = '1 - Critical',
Status = 'Logged',
Resoloution_Sub_Category__c = '');
cases.add(ct);
}
insert cases;
36. Limits
• Sales force has a number of hard limits that can be just as
annoying as the notes 32K limit but are there to protect
the platform
• SOQL Limits are 50,000 records per statement (1,000,000 in read only
mode)
• No more that 15 SOQL statements in a given function
• APEX run time out 10 Seconds (standard synchronous calls).
• List object cant hold more than 1000 objects.
• More Limits: https://developer.salesforce.com/docs/atlas.en-
us.apexcode.meta/apexcode/apex_gov_limits.htm
36#engageug
37. Testing
• To promote code from a Sandbox to Production 75% of
your code needs to be reachable via a test class
• You can see your code coverage level from the developer
console
37#engageug
38. Testing – Developer Console.
38#engageug
Code that is covered
by tests
Code that is not Tested
39. Keeping up to date
“All certified professionals are required to maintain their
certification by taking a maintenance exam every release
cycle.”
“Release cycles are about four months in length”
“If you do not pass the release exam by its deadline, all
credentials maintained by that exam will expire, or in some
cases become suspended. “
39#engageug
https://help.salesforce.com/HTViewSolution?id=000186547
41. Fun Quirks
41#engageug
• Cases are kept in the “Case” table, Accounts are kept in
the “Account” table etc etc…. Products are kept in the
“Product2”
• To lookup a standard field
• To get value: case.account
• To get relationship value: case.account.Name
• To lookup a custom field
• To get value: case.customaccount__C
• To get relationship value: case. customaccount__R.Name
42. Renaming Stuff
• All code is checked
for dependencies, if
you try and rename
an object or attribute
and it is used else
where you will be
stopped.
42#engageug
44. Top Tips.
• Stop your users updating live while you are writing new
Updates (and make sure your sandboxes are up to date)
• Keep a note of every element you change as it makes it
easier to build your Outbound Change Sets.
• Cater all your code to run on millions of records.
• Invest in a good alternative Code editor
44#engageug
45. Code Editors - Alternatives
• Atom
• My Preferred text editor
• Integration plug in https://atom.io/packages/mavensmate-atom
• Subline
• Well thought off and excellent editor
• Great plugin for salesforce integration
https://github.com/mailtoharshit/Weave#installation
• Eclipse
• The original IDE for salesforce, but I have seen very few people actually
use it recently and a lot of complaints on the forum.
45#engageug