• jesuscs
  • NEWBIE
  • 35 Points
  • Member since 2012

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

Hi, everyone

 

I need your help to understand and fix this problem:

I built an apex text class in a sandbox environment (i'm using eclipse) but when I run this apex test class I'm getting this error: System.QueryException: List has no rows for assignment to SObject. The problem is that the object really has records both in sandbox and in production environment !!!! I run that query in Force.com Explorer, salesforce.shema Explorer, etc. and there I can see the existing records but in the test all the time throws that error... Could anyone please guide me why is it happening and how can it be fixed?

Hi, everyone

 

I need your help to understand and fix this problem:

I built an apex text class in a sandbox environment (i'm using eclipse) but when I run this apex test class I'm getting this error: System.QueryException: List has no rows for assignment to SObject. The problem is that the object really has records both in sandbox and in production environment !!!! I run that query in Force.com Explorer, salesforce.shema Explorer, etc. and there I can see the existing records but in the test all the time throws that error... Could anyone please guide me why is it happening and how can it be fixed?

I have a page reference that returns me to the object the user started on. It works great, except the URL is still the Visualforce page. It was my understanding that setRedirect(true) accomplished this. I know it used to work like this, but at some point this functionliaty changed and it no longer updates the url.

 

Anyone know how I can accomplish the URL to be updated with my page reference? It's causing some minor confusion when people "refresh" and end up going to the VF page they just left.

 

public PageReference SaveProducts() { PageReference ReturnPage = new PageReference('/' + Master.id); ReturnPage.setRedirect(true); return ReturnPage; }