• anthony_id
  • NEWBIE
  • 30 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
    Questions
  • 8
    Replies
@testSetup has been great for reducing our SOQL queries in tests and generating reusable test data. However, the documentation is severly lacking with regard to the data model and flow and I've been running into some brick walls that I can't seem to overcome.  A more technical diagram with data flow/life cycle would be marvelous since I'm finding it's a lot of trial and error (e.g. once queried in a test method, data needs to be re-queried to see any effects of a trigger - not very intuitive)

Here's my current issue - my after insert triggers don't seem to be firing when I create data in my setup method. I have system.debug('=== trigger.isInsert: ' + trigger.isInsert:); in my trigger which *does* include after insert - it never shows up in the debug logs. Updates do, deletes do, but not inserts. I need to test my insert triggers and I'd rather not recreate all the data in the method. The data has obviously been inserted becuase I can query it, so why isn't it firing the insert trigger? (or, if it is, why doesn't it show up in the debug logs?) 

I'd love to hear your thoughts, thank you

With Communities replacing portals in Summer '13, we've been working to convert our current customer portal and add many of the features afforded with Communities.  One of the features is "Global Search" but it seems to have a huge security/privacy hole (at least for our customers) in that it returns People and their associated Companies. Our customers would NOT like that data exposed to other people without their consent.

 

I see that Salesforce is limiting thee objects searched in the UI in their https://success.salesforce.com/ site (upper right hand corner) - we would like to lock our search down to only a few objects in a similar way. How do we do this? I haven't found any configuration, component or code or any documentation relating to this feature. If anyone can point me in the right direction, it would be much appreciated.

 

Thanks

I've been racking my brain on this one and I've not been able to figure out why php Chr() returns a different result than fromCharArray for very large integers.  I need to replicate some code to generate a token for a third party integration and have been wildly unsuccessful.

PHP Code snippet:
$nExpires = 1370359009; //this number is generated via epoch time + some additional values
$sExpByte1 = chr($nExpires & 0xff);

Apex Code
Integer TokenExpires = 1370359009; 
String expByte1 = String.fromCharArray(new integer[] {TokenExpires});

If I echo $sExpByte (or convert using Ord() or base64Encode()) I get a different result than when I output expByte1 in a test method using a string representation in assertEquals()

 

What do I need to do to get the Apex to match the PHP?

 

Thanks!

 

 

@testSetup has been great for reducing our SOQL queries in tests and generating reusable test data. However, the documentation is severly lacking with regard to the data model and flow and I've been running into some brick walls that I can't seem to overcome.  A more technical diagram with data flow/life cycle would be marvelous since I'm finding it's a lot of trial and error (e.g. once queried in a test method, data needs to be re-queried to see any effects of a trigger - not very intuitive)

Here's my current issue - my after insert triggers don't seem to be firing when I create data in my setup method. I have system.debug('=== trigger.isInsert: ' + trigger.isInsert:); in my trigger which *does* include after insert - it never shows up in the debug logs. Updates do, deletes do, but not inserts. I need to test my insert triggers and I'd rather not recreate all the data in the method. The data has obviously been inserted becuase I can query it, so why isn't it firing the insert trigger? (or, if it is, why doesn't it show up in the debug logs?) 

I'd love to hear your thoughts, thank you

With Communities replacing portals in Summer '13, we've been working to convert our current customer portal and add many of the features afforded with Communities.  One of the features is "Global Search" but it seems to have a huge security/privacy hole (at least for our customers) in that it returns People and their associated Companies. Our customers would NOT like that data exposed to other people without their consent.

 

I see that Salesforce is limiting thee objects searched in the UI in their https://success.salesforce.com/ site (upper right hand corner) - we would like to lock our search down to only a few objects in a similar way. How do we do this? I haven't found any configuration, component or code or any documentation relating to this feature. If anyone can point me in the right direction, it would be much appreciated.

 

Thanks

I've been racking my brain on this one and I've not been able to figure out why php Chr() returns a different result than fromCharArray for very large integers.  I need to replicate some code to generate a token for a third party integration and have been wildly unsuccessful.

PHP Code snippet:
$nExpires = 1370359009; //this number is generated via epoch time + some additional values
$sExpByte1 = chr($nExpires & 0xff);

Apex Code
Integer TokenExpires = 1370359009; 
String expByte1 = String.fromCharArray(new integer[] {TokenExpires});

If I echo $sExpByte (or convert using Ord() or base64Encode()) I get a different result than when I output expByte1 in a test method using a string representation in assertEquals()

 

What do I need to do to get the Apex to match the PHP?

 

Thanks!

 

 

Hi all,

 

I've posted before on Twitter about the browser-based developer console, and hinted at some of the issues I've had (overall though, I do like it), but not put them down in any meaningful fashion.

 

One of my dev orgs was updated to summer 12 this weekend and I've encountered an issue that's a real nusiance, so it's prompted me to post here to explain it in full. I'll also use this thread to list some of the other issues/areas for improvement.

 

Anyway, the main issue I'm having at the moment: before the update, the console was pretty good at working out when I had done something stupid and preventing the save, which allowed me to fix and save again once correct. After the update however, I get notified of the problem after I try to save, and worse, when I make changes, I can't save the file. I have to close the developer console window and open it again, re-do my changes and then save.

 

Previously I think this is how it worked:

  1. User made changes to code in the console
  2. As user made changes, either javascript on the page ran checks on the code, or sent the changes to the server - but did not commit them
  3. When the user clicked save, the file was committed. The user could only save if the console thought the code was valid i.e. if the code passed step 2.

 

Now, it's as if the following is happening:

  1. User makes changes to code in the console.
  2. User clicks save - it is only at this point that the code goes to the server.
  3. If there are errors in the code, the user is told there is an error. Internally, the console notes the code is invalid because the server has told it so.
  4. User fixes the error, but cannot save the code as the console believes the code is invalid, because the server told it. The console should try to save the file again and await the new result.

 

Hope that makes sense - any one else experiencing the same? I'm using Chrome, haven't tried other browsers as yet.

 

Other issues I've been meaning to post about:

 

  • No asterix on tab names - OK, this is a Summer 12 change. Previously, when you had multiple files open in the console, ones you'd changed but not saved were shown with an asterix against their name in the tab. This was useful but has been removed.
  • Refresh - Every now and again you'll get a message about having to refresh logs manually, even when there are no logs open. You get one of these messages for every class/page you have open.
  • Attribute suggestions - The editor can be a bit keen to suggest attributes for VF tags as you move around code. Actually this looks like it may have been fixed :)

 

Those are the only ones I spring to mind right now. I'll bookmark this thread and add more as I think of them.

 

I don't want to sound overly negative about the developer console - niggles aside, I was really quite happy with the last release's version, so much so that I made it my first choice for development over the Force.com IDE, and I really like the look of some of the things in the latest release. And it's all a long, long way away from the options we had, even as little as a year ago, so please keep up the great work :)

 

  • May 14, 2012
  • Like
  • 0