Add Opportunity Contact Roles on Opportunity Update

We're sending an email campaign through Pardot excluding customers who placed an order with us or prospects whom we provided Customer Quotation (SCM Module by Financial Force) within the past 30 days. To exclude this list, we must sync Salesforce Opportunity to Pardot Opportunity. Pardot opportunity is tied to a prospect where Salesforce Opportunity is not directly tied to contacts but through Accounts and OpportunityContactRoles. In order to sync Salesforce Opportunity with Pardot Opportunity, OpportunityContactRoles must be created in Salesforce Opportunity. When a Salesforce lead is converted (creating an account, contact, and opportunity), OpportunityContactRoles are automatically created. Similarly, when a new Salesforce Opportunity is created OpportunityContactRoles are automatically created (via traversing Opportunity -> Account -> Contact). However, when a new contact is added to an Account within Salesforce; the new OpportunityContactRole is not automatically created. To exclude those newly added contacts to be excluded, we must run the one-time script via Developer Console to add OpportunityContactRole.

Salesforce: Retrieve related list with SOQL and Apex

You are working with a Salesforce custom object, and you need to iterate through the related list. How do you retrieve the listed list with SOQL, and iterate through them with Apex? For illustration purposes, I'm going to use the Financial Force object, SCMC__Sales_Order__c. The SCMC__Sales_Order__c has a child relationship, SCMC__Purchase_Orders__r, as shown in the (Force.com IDE) screenshot below.

Syntax Highlighter Usage (SYNTAXHIGHLIGHTER-OPTIONS)

I have been searching for a Syntax Highlighter plug-in for WordPress and Drupal and decided to install the one available from Alex Gorbatchev. The module makes use of the Syntax Highlighter Javascript Library, and does the job I wanted. In order for the Syntax Highlighter plug-in to work, you'll have to install both the Javascript library and the module developed for Drupal or WordPress. Once the module is installed, the syntax for using it is pretty much the same.

Salesforce: How do you change user's password with developer console?

As Salesforce dominates the CRM market space, it has grown to support many industries and unique business requirements. Becoming an ecosystem that is so big to encompass every industry and companies of all sizes, the administration of Salesforce became very complex. The following list of Salesforce administrative guides will help admins perform their daily duties and be used as a reference for their administrative tasks.

Getting Started with GIT and GITHUB

I have been involved in software development for over 20 years, and have used various version control software including SCCS, CVS, Perforce, Clearcase, Visual Sourcesafe, and SVN. Over time, the SCM trend has changed from file locking mechanism to distributed version control and GIT is gaining popularity with growing users. As a software engineer, SCM is a critical part of your daily chores but you don't want to spend much time maintaining it.

Salesforce Apex FAQ

Salesforce Apex resembles Java programming language, but it uses objects to represent primitives and also offers pre-built methods for commonly performed tasks. Here is a list of commonly used primitive object methods, and functions that can be used with Apex programming language.

How to install UTM tracking code? (Uses ga.js)

The UTM (Urchin Traffic Monitor) tracking code is used to track traffic source, medium, and campaign; and allows businesses to track conversion funnel from referral site. With the introduction of Google Tag Manager, some folks are unclear how to implement UTM tracking codes into their HTML pages. The following two simple steps will guide you through installing the UTM javascript snippets into your web pages.

Google Analytics Cookies (utma, utmb, utmz)

Google Analytics uses cookies to keep track of visitors' web statistics. When you install Google Analytics javascript tracking code on your website, cookies are written to your visitors' computers to keep track of their activities on your website. Cookies store visitor's first visit, page views, how long they stayed on your site, entry point, and exit point among others. Cookies set by Google Analytics include __utma, __utmb, __utmc, __utmv, __utmx, and __utmz; and samples of those cookies are as follows:

PHP Performance Tuning with Xdebug and KCacheGrind

One of our WordPress websites was running very slow, so I have been asked to diagnose the application. The website was running in upwards of 6 seconds to load the homepage, and 8+ seconds to load woocommerce product pages. There are several debugging and profiling tools available in the PHP realm, and Xdebug is an excellent choice. New Relic (free and premium versions) is another choice for profiling and debugging PHP applications.