Contributing to an Open Source Salesforce Managed Package

Use Case: Volunteers for Salesforce

Some Salesforce managed packages provide developers in the community the opportunity to contribute with code and features. Packages such as the Non Profit Starter Pack or Volunteers for Salesforce are open source software, which means developers can contribute to the code on GitHub (https://github.com/) resulting into new features or improvements to the software. These features are then packaged into the managed version being upgraded.

University of New Hampshire engaged Daizy Logik to develop several enhancements to Volunteers for Salesforce that were then incorporated back into the package. Based on this work we developed this step-by-step technical guide on how to successfully contribute to an open source Salesforce managed package. The process described here uses Volunteers for Salesforce as an example but could be more generally applied to any open source managed package.

Development Environment Setup

To facilitate the setup of your development environment we recommend using these freely available utilities that should be available on both Mac and PC. 

Client Feature: the Fund for Global Human Rights

Print

Founded on the core belief that on-the-ground activism is the bedrock on which respect for human rights is built, the Fund for Global Human Rights started with the simple but pioneering approach of directing financial resources to locally-rooted rights groups with transformative potential. Since 2002, the Fund has made over $69 million in grants and facilitated hundreds of hours of capacity building to over 550 human rights organizations in Asia, Africa and Latin America. This support has helped to fuel the development of effective national actors and movements that have increasingly come to be seen as nimble, influential challengers holding governments and other powerful actors to account.

Just in 2015, organizations the Fund supports:

  • Successfully advocated for the passage of a law prohibiting child marriage in Pakistan
  • Persuaded hospitals in Sierra Leone to provide treatment for victims of sexual violence during the Ebola crisis
  • Trained Liberian police on LGBTI rights, leading them to establish a hotline for LGBTI people to call in case of attack
  • Pushed Tunisia to establish a commission to investigate the cases of 1,500 migrants disappeared at sea
  • Prevented a budget cut to India’s National Rural Employment Guarantee Act which guarantees rural laborers a minimum of 100 days of work per year
  • Forced the Honduran Supreme Court to overturn the conviction of an activist imprisoned for political reasons

Case Study

The Fund for Global Human Rights relies on Salesforce to track and manage grants and individual donations. In addition to some general cleanup, the Fund engaged DaizyLogik to address two particular challenges that were preventing them from getting the most out of Salesforce.

Read more.

Salesforce Push Upgrade – How To

Creating a Patch for a Managed Package and Doing a Push Upgrade

Posted by Nineta Martinov

Recently I had to create a Patch for one of my clients’ managed package in order to make a minor change and push it out to all the client organizations using the package. For the most part the Salesforce documentation is fairly accurate in guiding one through the process. However, I could not find any help with screenshots documenting the end-to-end process so I put this together.

Remember that a Patch should only be created if no new components are being added to the managed package. For example, if you want to change the wording in a Visualforce page you would want to use a Patch.

Step1. Log into the main development org. This is where you developed the managed package. Go to Create -> Packages and click on the Managed package name.

Interact with Salesforce Data through a Drag and Drop Interface

Salesforce Data can be exposed to the end users via Visualforce pages. The responsiveness and interactivity of the UI can be enhanced with a javascript framework such as jQuery.

The data I am representing here consists of Projects and Teams. Projects have a Start Date and End Date, and can be assigned to a Team. The structure and data look like this:
erdteam

project

Using a Visualforce page enhanced with jQuery and leveraging the gridster.js grid, we can create a more intuitive UI, as shown below:

Should I use Process Builder or write Apex code?

If you have asked yourself this question recently here are some tips that can help you decide which path you should take. Imagine you have to implement the following scenario:

Use Case:  Users are signing up online and filling out a form. They have to provide contact information for 4 additional Contacts at their organizations. For each additional Contact they will enter a First Name, Last Name, Email, Phone and Role. All this information will be automatically fed to Salesforce in the form of an online subscription record.

For each additional Contact you are required to first determine if it exists in Salesforce and if not then create it. If you find the contact in Salesforce (based on Last Name and Email) then you have to update the Phone, set the mailing address and create an Affiliation to the Account/Organization with the specified role.

(Please note that this use case uses Affiliations which are a custom object specific to the SF Non Profit Starter Pack. An Affiliation is a junction object between a Contact and an Account.)

The PROCESS BUILDER AND FLOW ROUTE

It is possible to go the process builder route for this one.

When Do You Need a Developer for a Migration to Salesforce?

In many instances, the data to be migrated in Salesforce is simple enough that it can be imported with a tool like Jitterbit or the Salesforce Data Import Wizard.

There are some situations though, when the migration might be difficult or cumbersome to implement with one of these tools. It’s likely that in these cases developing an application will be more cost-effective than the standard approach.

Here are a few cases when a Salesforce developer should create an application to process the data import by using Visualforce and Apex:

How to Schedule a Batch Job every 30 Minutes

  1. Create a class that implements the Batchable and Schedulable interfaces
  2. Connect to the Developer Console
  3. Go to Debug / Open Execute Anonymous Window
  4. Enter this code and execute it
  5. Monitor your scheduled jobs
  6. If you need to run the job more often, like every 15 minutes, create two additional jobs:one for 15 minutes, and one for 45 minutes.

System.schedule('myJob_00', '0 0 * * * ?', new myClass());
System.schedule('myJob_30', '0 30 * * * ?', new myClass());

by Vladimir Martinov

Pledge Rollup Unmanaged Package

Some non-profits want to rollup pledges (donations with StageName=’Pledged’). NPSP provides user-defined rollups for ‘Posted’ donations.

Daizylogik has built an unmanaged package for Pledge Rollups on Accounts and Contacts for the current and previous calendar and fiscal years. It also, rolls up the Payments for pledges.

You can install it from here:
https://login.salesforce.com/packaging/installPackage.apexp?p0=04t61000000gOV2
The source code is available here: https://github.com/daizylogik/DZ_DEV.git

Post Installation Instructions:
1. add the following fields to the Account and Contact page layout:
Pledge_Payment_Amt_Recvd_Current_CY__c
Pledge_Payment_Amt_Recvd_Current_FY__c
Pledge_Payment_Amt_Recvd_Previous_CY__c
Pledge_Payment_Amt_Recvd_Previous_FY__c
Total_Pledges_Current_CY__c
Total_Pledges_Current_FY__c
Total_Pledges_Previous_CY__c
Total_Pledges_Previous_FY__c

2. Edit the Search Layout for the Opportunities, and the add the Calculate Pledge Totals button, so you can run the rollups on demand.

3. If you would like to schedule the rollup job, use the PledgeRollupBatch class.

by Vladimir Martinov

 

How to Override the Edit Button Based on Record Type

This is how you can override the Edit action for Book__c custom object. If the record type is Alpha you will be directed to a new page, otherwise you go to the standard edit page.

<apex:page standardController="DaizyLogik__Book__c" action="{!URLFOR(
CASE(DaizyLogik__Book__c.RecordType.Name, 'Alpha', $Page.BookAlpha,
'/' + DaizyLogik__Book__c.Id + '/e?nooverride=1'),
DaizyLogik__Book__c.Id) }">

<apex:variable value=”{!DaizyLogik__Book__c.RecordType.Name}” var=”recTypeName”/>
</apex:page>

by Vladimir Martinov

 

Successful Salesforce implementation with a distributed team

It is becoming more commonplace these days for the team doing the Salesforce implementation to not be physically co-located. In fact, it is very likely that your next Salesforce project will involve a physically distributed team. How can you adapt your project management, design, development and overall project communication style to deliver a project of this nature and be successful at it?

1. Communicate
It is crucial to pick tools that facilitate communication among the team members during regular project meetings and at all times during the course of the project. The choices for online communication tools are quite diverse these days but I find that the best criteria for choosing the right one are: audience and price.