Archives

Apex Update Case Priority when Bad Words in Incoming Email

Updating a case priority of a case when you receive a email with some words in the body that will make it more important. By looking at the words you can update the priority to high so Support reps can faster attend to those cases

Rate this:

Read More

SalesIO JQuery Mobile Force.com Mobile Application

SalesIO is Force.com JQuery Mobile Iphone App provides all the functionality that a busy sales rep will need to easily manage their day to day lifes. SalesIO provide: Manage the basic Sales SObjects : Leads, Contacts, Accounts, Opportunities Manage the basic Support SObject: Cases Connect with customers using SMS and Email and Chatter Graphs at […]

Rate this:

Read More

Force.com Apex and Visualforce Best Practices

Triggers There should only be one trigger for each object. Apex Trigger Code trigger ContactTrigger on Contact (after delete, after insert, after undelete, after update, before delete, before insert, before update) { ContactTriggerHandler handler = new ContactTriggerHandler(Trigger.isExecuting, Trigger.size); if(Trigger.isInsert && Trigger.isBefore) { handler.OnBeforeInsert(Trigger.new); } else if(Trigger.isInsert && Trigger.isAfter){ handler.OnAfterInsert(Trigger.new); ContactTriggerHandler.OnAfterInsertAsync(Trigger.newMap.keySet()); } else if(Trigger.isUpdate && Trigger.isBefore){ […]

Rate this:

Read More

Dynamic SOQL Queries packages and security

For managed packaged development dynamic SOQL queries assist developers with creating soql queries on the fly without hard coding field names which may not be there in all orgs. When you install an managed package you may run into trouble is some fields do not exist. This is why dynamic SOQL queries can be┬ábeneficial┬áby using […]

Rate this:

Read More

Minimize and Optimize Apex Test Classes with SmartFactory

I was writing allot of test code to create SObjects and all the necessary fields. There are some problems when writing test code when specifying all the necessary fields. Some of the things to consider when creating test fields is required fields and pre-populating lookups. Let us look at some examples: Let’s start of creating […]

Rate this:

Read More

Force.com IDE MavensMate for the serious Apex developer

You are frustrated with coding Apex in Eclipse because it is slow or you are coding in the browser :( not the best thing when you close the window and loose all your code…to the rescue MavensMate. MavensMate is an Force.com IDE is an add-on project running on Sublime Text 2. I have been using […]

Rate this:

Read More

Query SObject without burning SOQL queries

When you are writing Apex code you want to minimize the amount of SOQL queries in your code. One of the ways todo this is to create an SObject with some information of that object. Let us say you have the following SOQL query: Contact getAccountId = [Select AccountId from Contact limit 1]; Now you […]

Rate this:

Read More

Salesforce Update Product Schedule from Opportunity Product using Apex Trigger

Update the Product ScheduleDate when the Opportunity Product ServiceDate changes. First we create an OpportunityProduct Trigger to see when ServiceDate changes and parse the amount of days difference between the old and new date. trigger ProductDateUpdate on OpportunityLineItem (after update) { for (OpportunityLineItem oli: Trigger.new) { OpportunityLineItem oldCloseDate = Trigger.oldMap.get(oli.ID); if (oli.ServiceDate != oldCloseDate.ServiceDate) { […]

Rate this:

Read More

Salesforce Update Product Schedule from Opportunity using Apex Trigger

The tutorial below shows how you can use Salesforce Triggers to update the CloseDate of an opportunity and the associated Product Schedule. First thing is we must create a product Trigger, below is the code for the product trigger: trigger OpportunityScheduleUpdate on Opportunity (after update) { for (Opportunity o: Trigger.new) { Opportunity oldCloseDate = Trigger.oldMap.get(o.ID); […]

Rate this:

Read More

Follow

Get every new post delivered to your Inbox.

Join 215 other followers