• Greg Fee
  • NEWBIE
  • 50 Points
  • Member since 2010

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 10
    Replies

I have a piece of code that does this:

 

Integer numBookings = zoneBookingMap.get (zoneId);

numBookings = (numBookings == null) ? 1 : numBookings + 1;

 

This code worked perfectly prior to the release of the recent update.

 

Now, however, numBookings ALWAYS comes back as null!  I tested this by changing the code to:

 

Integer numBookings = zoneBookingMap.get (zoneId);
if (numBookings == null) {
  numBookings = 1;
} else {
  numBookings = numBookings + 1;
}

 

And it fixed the problem.  But this is a huge issue as I use similar code throughout our system.

  • February 09, 2012
  • Like
  • 0

Writing a class right now that handles inbound mail with possibly-somewhat-large text attachments.  The intent is to parse the attachment and do stuff with the contents.

 

Because Apex strings are similar to Java strings - in particular, they are immutable - I assumed/hoped that substring() would behave like Java substring, returning a lightweight object that just has offset pointers into the original string data.  No copying necessary.

 

However, that doesn't seem to be the case.  Tests with a 5,000 character string that has five 4,0000 character substrings taken out show that the heap grows by 4K with each substring operation:

 

 

string s = '...'; // build your own 5K string here

System.debug('pre: ' + Limits.getHeapSize());

string s1 = s.substring(0,4000);
string s2 = s.substring(0,4000);
string s3 = s.substring(0,4000);
string s4 = s.substring(0,4000);
string s5 = s.substring(0,4000);

System.debug('post: ' + Limits.getHeapSize());

 

 

Output:

 

13:46:51.317|USER_DEBUG|[58]|DEBUG| pre: 5100
13:46:51.318|USER_DEBUG|[66]|DEBUG| post: 25100

 

This isn't a bug, per se, and I understand that Apex is an interpreted language, but this seems like it could be a straightforward performance win to leverage the underlying Java string mechanics.

 

  • November 10, 2010
  • Like
  • 0

I have a piece of code that does this:

 

Integer numBookings = zoneBookingMap.get (zoneId);

numBookings = (numBookings == null) ? 1 : numBookings + 1;

 

This code worked perfectly prior to the release of the recent update.

 

Now, however, numBookings ALWAYS comes back as null!  I tested this by changing the code to:

 

Integer numBookings = zoneBookingMap.get (zoneId);
if (numBookings == null) {
  numBookings = 1;
} else {
  numBookings = numBookings + 1;
}

 

And it fixed the problem.  But this is a huge issue as I use similar code throughout our system.

  • February 09, 2012
  • Like
  • 0

Writing a class right now that handles inbound mail with possibly-somewhat-large text attachments.  The intent is to parse the attachment and do stuff with the contents.

 

Because Apex strings are similar to Java strings - in particular, they are immutable - I assumed/hoped that substring() would behave like Java substring, returning a lightweight object that just has offset pointers into the original string data.  No copying necessary.

 

However, that doesn't seem to be the case.  Tests with a 5,000 character string that has five 4,0000 character substrings taken out show that the heap grows by 4K with each substring operation:

 

 

string s = '...'; // build your own 5K string here

System.debug('pre: ' + Limits.getHeapSize());

string s1 = s.substring(0,4000);
string s2 = s.substring(0,4000);
string s3 = s.substring(0,4000);
string s4 = s.substring(0,4000);
string s5 = s.substring(0,4000);

System.debug('post: ' + Limits.getHeapSize());

 

 

Output:

 

13:46:51.317|USER_DEBUG|[58]|DEBUG| pre: 5100
13:46:51.318|USER_DEBUG|[66]|DEBUG| post: 25100

 

This isn't a bug, per se, and I understand that Apex is an interpreted language, but this seems like it could be a straightforward performance win to leverage the underlying Java string mechanics.

 

  • November 10, 2010
  • Like
  • 0

Anyone know anything about a namespace limit of 10?  Can't find anything in the documentation and SFDC support promised to get back to me and never did. 

  • August 17, 2010
  • Like
  • 1

Does bind parameters work when they appear in the "INCLUDES" clause of SOQL. Here's my observation

 

 
String userTypes='\'All\',\'Avon Leader\'';
String titleLevels='\'All\',\'4\'';
String SPLASHPAGE_TYPE='Splash Page';
System.debug('>>>>>>>>>>>>>>>userTypes='+userTypes);
System.debug('>>>>>>>>>>>>>>>titleLevels='+titleLevels);
List<Market_Content__c> mcList = [select        Type__c,Content_Type__c,Content__c, User_Type__c,
Title_Levels__c, Market__r.Name
from Market_Content__c
where Type__c='Splash Page'
and Market__r.Market_Id__c = 'RO'
and User_Type__c includes (:userTypes)
and Title_Levels__c includes (:titleLevels)
 order by CreatedDate];

 

This SOQL returns 0 rows. However the following SOQL returns 1 row:

 

List<Market_Content__c> mcList = [select       Type__c,Content_Type__c,Content__c, User_Type__c,                                                                                                                               Title_Levels__c, Market__r.Name                                                                         from Market_Content__c
where Type__c='Splash Page'
and Market__r.Market_Id__c = 'RO'
and User_Type__c includes ('All','Avon Leader')
and Title_Levels__c includes ('All','4')
order by CreatedDate];

 

What am I missing?

 

I can't seem to find the daily limits on Batch Apex in the documentation anymore.  Is there no longer a limit or am I just not finding it?

 

I skimmed everything I could find and all I can find is 2000 @future method calls per user license per day in a forum post.  Does that still apply to @future?