function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
BerettaJonBerettaJon 

String.difference

trigger TimestampFields on Survey__c (before update, before insert)
{
for (Survey__c c : Trigger.new)
{
Survey__c oldSurvey = Trigger.oldMap.get(c.ID);

if (c.Field1__c != oldSurvey.Field1__c) {
String new1 = c.Field1__c;
String old1 = oldSurvey.Field1__c;

String newStuff1 = old1.difference(new1);

 

Error: Compile Error: Method does not exist or incorrect signature: [String].difference(String)

 

http://www.salesforce.com/us/developer/docs/apexcode/Content/apex_methods_system_string.htm

Best Answer chosen by Admin (Salesforce Developers) 
8hrWait8hrWait

Hi,

 

The 'difference' method is part of Winter'13 Release. You might need to refresh your org to get the latest  features.

 

WInter '13  Release Notes can be accessed at -

http://developer.force.com/releases/release/Winter13

All Answers

8hrWait8hrWait

Hi,

 

The 'difference' method is part of Winter'13 Release. You might need to refresh your org to get the latest  features.

 

WInter '13  Release Notes can be accessed at -

http://developer.force.com/releases/release/Winter13

This was selected as the best answer
sfdcfoxsfdcfox

And on that note, I thank salesforce.com for finally implementing over half of my Data utility class as standard functions.