• GordymanLG2
  • NEWBIE
  • 25 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 6
    Replies

Why won't this SOQL query work?

 

Case tmpCase = [select Id from Case where IsClosed = true and OwnerId like '00G' limit 1];

 

I am trying to get a particular type of Case in a test class.  The compiler complains whenever I put in the LIKE expression.

 

If this won't work, any suggestions on how to do it?

 

Thanks.

I need to add some logic to the standard CaseView controller (specifically to capture the user IP address), but cannot use a VF page override because this would disable inline editing of the CaseView page.  Is there any way to get a class method to execute without being called from a VF page?

 

This logic would execute everytime the CaseView standard view was called.  I can't use the standard functionality provided to get the IP Address (e.g. ApexPages.currentPage().getheaders()) from within a trigger because the page context isn't relevant to the bulk processing nature of triggers.

 

Mike Gordon

aka GordymanLG2

 

 

Is it possible to get the current user's IP address from within a trigger?

 

Here is a snippet from a trigger I wrote to test the use of the ApexPages method (discussed in another posting thread). 

 

 

trigger SetUserIPAddress on Case (before insert) {

    PageReference pageRef = ApexPages.currentPage();
    Map<String,String> MapHeader = new Map<String,String>(pageRef.getheaders());

 

When I create a new Case invoking this trigger, I get a null page reference error as follows:

 

Apex trigger SetUserIPAddress caused an unexpected exception, contact your administrator: SetUserIPAddress: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.SetUserIPAddress: line 4, column 59

 

 

Can I only access this method from within a class controller and not from within a trigger?  nce I figure out how to get the URL header data into the map, I am good to go on extracing the correct IP address from the values in the Map.  Any help would be appreciated.

 

GordymanLG

I am trying to deploy a Customer Portal to another org (and soon to Production).  In the org there are Home Custom Links that contain the RecordID for the Case and a URL parameters called _CONFIRMATIONTOKEN.  I know how to update the RecordID from org to org, but don't have the foggiest idea if or how to update the _CONFIRMATIONTOKEN.  Here is an example of one of the links.

 

/500/e?retURL=%2F500%2Fo&RecordType=012T00000000Khl&_CONFIRMATIONTOKEN=fAl2SM27RODyy_.edkDqvJz1oUWw2hbA6rSNYzjIHDghcpDWvsuua_POuzr54y.RHk4XIMzgwB82lZZPKUlT44XEX3zpIre7qW9omUvtbZOm.R2642bixMEmy63scamPLZZSWPTu0kShjyMSTLKMqwEj9jUcqZzY8LC05JXN81x6iFIr&cancelURL=%2Fapex%2FCaseTab%3Fsfdc.tabName%3D01rQ00000004N3N&ent=Case&cas7=Open&cas11=Phone&nooverride=1&cas6=Product%20Claim

 

Can anyone help?

 

Thanks.

My customer has an active Production environment that primarily uses a Public Read/Write model for most Objects.  This worked for them when the only users were internal. 

 

We have refreshed Production to a full Sandbox and have setup Customer Portal for them.  When a Portal user does an advanced search, they are seeing a variety of records that do not seem to be "owned" by them, directly or indirectly.  For example, they can see an attachment file that is associated with an Email template.

 

Are there any general guidelines for orgs which have customer portal in use?  I am not excited about changing their entire model to Privaate then adding sharing rules (All Internal Users to All Internal Users - Read/Write) because when I did this for Cases some queue-related access broke.  This is a large production org, so sweeping changes could be disastrous.  UAT across all functions would be a huge undertaking which would involve Marketing, Sales, etc. as well.

 

Any thoughts?

 

 

Why won't this SOQL query work?

 

Case tmpCase = [select Id from Case where IsClosed = true and OwnerId like '00G' limit 1];

 

I am trying to get a particular type of Case in a test class.  The compiler complains whenever I put in the LIKE expression.

 

If this won't work, any suggestions on how to do it?

 

Thanks.

Is it possible to get the current user's IP address from within a trigger?

 

Here is a snippet from a trigger I wrote to test the use of the ApexPages method (discussed in another posting thread). 

 

 

trigger SetUserIPAddress on Case (before insert) {

    PageReference pageRef = ApexPages.currentPage();
    Map<String,String> MapHeader = new Map<String,String>(pageRef.getheaders());

 

When I create a new Case invoking this trigger, I get a null page reference error as follows:

 

Apex trigger SetUserIPAddress caused an unexpected exception, contact your administrator: SetUserIPAddress: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.SetUserIPAddress: line 4, column 59

 

 

Can I only access this method from within a class controller and not from within a trigger?  nce I figure out how to get the URL header data into the map, I am good to go on extracing the correct IP address from the values in the Map.  Any help would be appreciated.

 

GordymanLG

I know there is are issues surrounding the use of Eclipse and the Force.com IDE on Windows 7 64-bit.  Here's what I've done and what I'm experiencing.

 

1. Uuninstalled the 64-bit JRE and installed the 32-bit version from the Sun website.

2. Installed Ganymede version of Eclipse from the Eclipse.org website

3. Followed the wiki instructions for installing the force.com IDE through the Eclipse software updates path.

 

Everything seems to install just fine.  I am able to create a Force.com project and download Apex components from my org and edit some of my triggers.

 

Then the trouble begins.  I close Eclipse and restart.  It is as if I never installed the Force.com IDE.  It does not show up in Perspectives or in New Project -> Other.  When I go to Help->Software Updates, Force.com IDE does show up as installed software.

 

Anyone have any suggestions to make this work on the 64-bit Windows 7 environment? 

 

I am considering "buying" a new laptop to complete my project.  Fortunately I have a Windows 7 upgrade license available.  I'm hoping to reinstall Windows 7 32-bit on this new machine over the 64-bit version (which is all that seems to come preloaded on anything anymore).  Does anyone have any experience with this configuration?

 

Thanks.