Skip to main content

Posts

Showing posts from 2014

Set Up Test Data for an Entire Test Class - Spring15

You can reduce test execution times especially when you’re working with many records. Test setup (@testSetup) methods enable you to create common test data easily and efficiently. By setting up records once for the class, you don’t need to re-create records for each test method. If a test class contains a test setup method, the testing framework executes  the test setup method first, before any test method in the class. Records that are created in a test setup method are available to all test methods in the test class and are rolled back at the end of test class execution.

Run More Future Methods and Callouts - Winter15

The execution limits of future methods and callouts in an Apex transaction have increased to 50 methods and 100 callouts respectively, which was 10 earlier. These limit increases enable you to do more with Apex without having to be restricted by the previous limits. I will say best of the lot in  #Winter15  . It will make developers life easy for sure!

Preserve sObject Field Encryption in Visualforce Expressions - Winter15

For Visualforce pages set to API version 32.0 or later, expressions that reference encrypted sObject fields return the encrypted values instead of the decrypted (plain) values. This behavior more closely matches your expectations and reduces the risk of inadvertent exposure of sensitive data due to programmer error. An expression might be used with a Visualforce  component that displays it, such as <apex:outputText> or <apex:column>, or as a “raw” expression on the page, for example, {! myObject__c.encryptedField__c }. In these scenarios, the encrypted value, rather than the decrypted value, of the field is displayed. This behavior parallels the documented behavior of <apex:inputField> and <apex:outputField>, which display encrypted values for encrypted fields.

Provide Canvas Personal Apps Directly to End Users - Winter15

Canvas personal apps let you create connected apps designed specifically for end users across organizations, without relying on organization administrators for app distribution. With canvas personal apps, end users can discover, install, and seamlessly interact with the apps that you create. As an administrator, you can still install canvas apps in an  organization. Canvas personal apps give developers new freedom to create apps and allow users to install and use the apps immediately. Canvas personal apps also offer a lightweight way to integrate outside functionality with Salesforce for any number of users. End users install and use a canvas personal app right from the Chatter tab, which allows the app to connect to their Salesforce data. Because only the app’s metadata is installed, installation is quick and easy, and end users get only the functionality that they need. Salesforce is making Chatter stronger, another way to make collaboration effective.

Standard Style Sheets Combined by Visualforce - Winter15

Visualforce now combines various style sheets into a single file before referencing or serving them in page requests. Combining style sheets reduces the number of network connections that are required to load a page and its resources. Reducing the number of connections improves performance modestly and should particularly affect higher-latency connections,  such as those on some mobile networks. Previously Visualforce referenced and served these style sheets separately. The style sheet content is unchanged. You don’t need to do anything to take advantage of this improvement.

Remote Object Generally Available - Winter15

Remote Objects is generally available! There are two new query operators that you can use in your Remote Objects queries. The new query operators are as follows. - in: in, used for finding a value that matches any of a set of fixed values. Provide values as an array, for example, ['Benioff', 'Jobs', 'Gates']. - nin: not in, used for finding a value that  matches none of a set of fixed values. Provide values as an array, for example, ['Benioff', 'Jobs', 'Gates']. We can expect it to be more powerful in coming release.

Deploy Your Components in Less Time - Winter15

You can now deploy components to production by skipping the execution of all Apex tests for components that have been validated within the last four days. With Quick Deploy, you no longer have to wait for all tests to run for your deployment to complete in production. As part of a deployment to production, all Apex tests are run in the production organization.  If the organization contains a large number of Apex tests, the execution of all tests can be time-consuming and can delay your deployment. To reduce deployment time to production, you can perform a quick deployment by skipping the execution of all tests. Quick deployments are available only for validations with test runs that have passed in the last four days (96 hours) and that meet the code coverage requirements: the overall code coverage in the organization must be at least 75%, and Apex triggers must have some coverage. You can start a quick deployment only through the Salesforce user interface. Quick Deploy is av

Script Statement Limits Methods Removed

With Summer'14, the Limits methods for script statements have been removed but are available and deprecated in API version 30.0 and earlier. Because the script statement limit is no longer enforced in any API version since Winter ’14, the associated Limits methods are no longer needed. The affected methods in the Limits class are: getScriptStatements() getLimitScriptStatements( )

Describe Limits Removed

With Summer'14, limits for all Apex describe calls have been removed for all API versions. Describe calls include describes for sObjects, fields, field sets, child relationships, picklists, and record types. You’re no longer limited to describing 100 objects or to xecuting 100 describe statements.

External Organization-Wide Defaults Auto-Enabled for All Organizations

With Summer'14 External Organization-Wide Defaults enable you to set a different default access level for external users. Previously, if your organization wanted Public Read Only or Public Read/Write access for internal users but Private for external users, you would have to set the default access to Private and create a sharing rule to share records with all internal users. With separate organization-wide defaults, you can achieve similar behavior by setting the default internal access to Public Read Only or Public Read/Write and the default external access to Private. These settings also speed up performance for reports, list views, searches, and API queries. External organization-wide defaults simplify your sharing rules configuration and improve recalculation performance. Furthermore, they reduce overhead of sharing checks for search and reports, and improves sharing maintenance around realignments.

Description Field Added to Login IP Ranges

When setting the Login IP Ranges for a profile or your organization, you can also enter a description for each range to help identify the purpose of the range setting. To view or edit the Description field for login IP ranges for each profile: From Setup, click Manage Users > Profiles , then select a profile. In the profile page, go to the Login IP Ranges section. As you add or edit a Login IP Range, use the Description field to provide details, such as which part of your network corresponds to the range.  Very important feature for the organisations which have IP restriction in place. It was really difficult till now to keep track of which IP range is there for which location.

Clickjack Protection

Clickjacking is a type of attack that tries to trick a user into clicking something, maybe a button or link, because they perceive they are clicking something safe. Instead, the button or link performs malicious actions on your site leading to data intrusion, unauthorized emails, changed credentials, or other site-specific actions.  Hidden iframes that load your site's pages can be placed maliciously by an unrelated page that entices the user to click a button or link that appears below the hidden iframe. With clickjack protection, you can configure whether your browser allows frames or iframes over your site pages. The default clickjack level for Site.com is set to Allow framing by the same origin only. You can set the clickjack protection for a site to one of these levels: Allow framing by any page (no protection) Allow framing by the same origin only (recommended) Don’t allow framing by any page (most protection) Note: Same-origin framing allows the site’s page t

Daily Limit for Workflow Emails in Free and Trial Organizations

The daily limit for emails that are sent from email alert actions was changed for free and trial organizations in Spring'14. For Developer Edition organizations and those evaluating Salesforce during a trial period, email alert actions in workflow rules and approval processes can now send a maximum of 15 emails per day per standard Salesforce user license.

Analytics API Available in Apex

Use the Analytics API via Apex for faster performance and easier maintenance. All the capabilities of the Analytics REST API are also available in the Apex API. The Analytics REST API, introduced in Winter ’14, gives developers access to many reporting and charting features that were previously available only through the web interface. If your customization strategy rests on Apex coding rather than the REST API, you can now use Apex to make all the same calls you can make with the REST API. For example, here’s a way you could use Apex to automate a reporting workflow. This Apex code takes a report ID and message as input, runs the specified report, and posts a Chatter message to every user or entity listed as a grouping. Reports.ReportResults res = Reports.ReportManager.runReport(reportId); FeedItem[] posts = new FeedItem[res.getgroupingsDown().getgroupings().size()]; for(Integer i=0;i<posts.size();i++) {     FeedItem post = new FeedItem();     post.ParentId = UserInfo.ge

New Independent Auto-Number Sequence Test Option

A new option has been added to ensure that auto-number fields in your organization's records don’t have gaps due to test records created in Apex tests. This option isolates the auto-number sequence used in Apex tests from the sequence used in your organization. As a result, the creation of test data in Apex tests doesn't cause the sequence of auto-number fields to be higher for new non-test records in your organization. If this option isn’t enabled, there will be gaps in the auto-number field whenever Apex tests create test records with auto-number fields. For example, if Account has an auto-number field, and there are 50 account records in your organization, the field value of the last created account can be N-0050. After running an Apex test that creates five test accounts, this causes the auto-number sequence to be increased by five even though these test records aren’t committed to the database and are rolled back. Next  time you create a non-test account record, its a

Mashup Integration in Salesforce

During preparation for TA certification exam, I came across a word Mashup for integration a number of times. I explored about it and below is description:- Mashups, sometimes called “composites,” are hybrid applications created by bringing together several data sources and Web services to create a new application or to add value to an existing application. Behind the scenes, mashups may require different levels of integration, depending on whether the mashed-up data is only meant to be viewed, whether it can be edited, and whether data is actually transferred between systems. There are three types of mashup:- Client Presentation Mashup - In this type of mashup the integration takes place strictly at the visual level. It makes possible to view data from two or more applications in a browser,  without actually moving data between the applications. Example - Google Maps. Client Service Mashup - As mashups evolve, they are becoming more complex and sophisticated. Client ser

Test.loadData in TestMethod

Use Case -  Tired of writing many lines of codes just to create test data in test methods. Also, over the time, because of change in business requirement, you need to add/remove/modify fields from those test records. If yes, then Test.loadData() is best for you. Say we want to write a test method, in which we need to insert account records and its associated contact records. Before Test.loadData() , the only option was to create explicit account records insert them and then create contact records. Also you need to establish relation between account & contact records. If you need 1000 account & 2000 contact records, you can assume how many line of codes you need to write just for creation of test records. Solution -  Use Test.loadData() to create records using csv file and using just a single line of code. Taking above problem in mind, let us discuss how to do it. Let us first create a new field ( FakeId ) (API Name - FakeId__c ) on both Account & a new field

Big Objects in force.com platform

With Winter'14 salesforce introduced a feature called " Field History Retention ". It was in pilot and with Spring'14 release, it's still in pilot. It is first force.com feature that uses big data technologies. For more scalability, salesforce is working on big data technologies. And for this salesforce is working on new type of SObject ' Big Data '. Big objects are just like regular SObjects with more scalability, but less functionality. Platform is built on top of relation technology using Oracle as main data repository for multi tenant environment. Now for more scalability salesforce is working on multi tenant big data store using HBase , which is open source database. Salesforce is working on Phoenix project, which allows to run low latency queries on top of HBase . Initially Big Objects will come with let functionality and more scalability. When to use Big Object:- if record count > 100 millions can live with some platform

Deleting Components in Managed Packages

Starting Spring ‘14, ISVs can delete the following types of components when updating a previously released managed package. Custom Buttons or Links Custom Fields Custom Objects Custom Tabs Field Sets Record Types Validation Rules The deletion of these components was not supported previously, to avoid the risk of data loss or integration failures in subscriber organizations. However, the number of such components in a complex package can grow very large over multiple release cycles. The ability to delete managed components can be very useful in such cases. It gives ISVs greater flexibility in maintaining and upgrading their apps. Deleting any component will permanently delete any data that exists in that component, delete tracked history data, and change any integrations that rely on the component, such as assignment or escalation rules. Also, once you delete a component in a managed package, you can’t restore it or create another component with the same na

Polymorphic Relationship & SOQL Polymorphism

Problem:- In Event object, WhatId field can refer to ' Account ', ' Opportunity ', ' Campaign ', custom objects etc. I want to write a SOQL query which will return different set of fields based upon which object ' WhatId ' is referring to. Solution:- Before Winter'13 release,  you have to do extra work when making queries that involve polymorphic relationships. Since you don’t know in advance what type of object is being referenced, you might have to get the ID of a Name object instead, process this information in some logic code, and then do a second query using information from that Name object to get to the content of the referenced object. With Winter'13, salesforce has introduced the concept of Polymorphic SOQL . Polymorphic Relationship:-  A polymorphic relationship is a relationship where the referenced objects can be one of several different object types. For example, the What relationship field in an Event can referen

Custom Index on Deterministic Formula Field

Since the Winter ’13 release, you have been able to contact salesforce.com Customer Support to create a custom index on a formula field, provided that the function that defines the formula field is deterministic. Here are examples of common non-deterministic formulas. Force.com cannot index fields that: Reference other entities (i.e., fields accessible through lookup fields) Include other formula fields that span over other entities Use dynamic date and time functions (e.g.,  TODAY ,  NOW ) A formula is also considered non-deterministic when it includes: Owner, autonumber, divisions, or audit fields (except for CreatedDate and CreatedByID fields) References to fields that Force.com cannot index Multi-select picklists Currency fields in a multicurrency organization Long text area fields Binary fields (blob, file, or encrypted text) Standard fields with special functionalities Opportunity: Amount, TotalOpportunityQuantity, ExpectedRevenue, IsClosed, IsWon Cas

Add Salesforce project to a new Git repository

As a developer, when for first time, I thought of using Git as my central repository, I had no clue how to do it. After searching, I found that there are so many users who are looking for way to use Git with Salesforce project, but because of non-availability of guide, they can't. I was lucky to figure out how to do it. So below I am going to share first step i.e. how to push your code base to Git repository for the first time. Login to https://github.com Scroll down to find 'New Repository' link on the left bottom.  Click on 'New Repository' button and it will open  new repository butoon like below:-  Enter name of repository in 'Repository Name' box. Github will check if this name is already used, if not then it will let you use this name. You can select 'Public' or 'Private' based upon your requirement. For 'Private' repository you will need buy license. For simplicity I have keep my repository as 'Public'. Cl