• gpervukhin
  • NEWBIE
  • 0 Points
  • Member since 2012

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

Hi, everybody. I want to share my thoughts with you about the problem that I met with SOQL parser.

 

Here is the query that I tried to execute:

database.query('SELECT Id FROM Task WHERE ((AccountId IN (SELECT Id FROM Account WHERE Name like \'%test%\')) AND (ReminderDateTime > 2013-03-01T00:00:00Z)) AND (Status != \'Completed\')');

 

as a result I've got the following exception:

System.QueryException: Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions.

 

Let's analyze the query:

C1 = AccountId IN (SELECT Id FROM Account WHERE Name like \'%test%\')

C2 = ReminderDateTime > 2013-03-01T00:00:00Z

C3 = Status != \'Completed\'

 

Result:

... Where ((C1) AND (C2)) AND (C3)

 

 

Let's do another similar test. Everything works, if I reorganize the query in this way:

database.query('SELECT Id FROM Task WHERE (AccountId IN (SELECT Id FROM Account WHERE Name like \'%test%\')) AND (ReminderDateTime > 2013-03-01T00:00:00Z) AND (Status != \'Completed\')');

 

Analysis:

... Where (C1) AND (C2) AND (C3)

 

 

So, I can't see a real problem in the first query.

 

p.s.1: I do not exclude that this could be my error.

p.s.2: I will be very grateful for your answers, but please do not suggest to remove brackets, because this query is generated in code, and please suggest me to reorganize the query only if it's really incorrect.

The best way to create clear and user-friendly GUI for site is to use template page. Force .com platform provides such opportunity and we can create template and use it as a base page for other pages.

Also we can set default template name for our site and then we can refer to it by using global variable $Site.Template. But there is a big problem with it. Global variable $Site.Template has different values in developer and viewing modes.

So we have template page with name 'SiteTemplate' and page 'SiteLogin' which use this template. If I go to our site by entering the url address 'Default web address/SiteLogin' that template would be applied ($Site.template has value 'apex/SiteTemplate'). But in developer mode global variable $Site.template has other value ('site/SiteTemplate.apexp') and it`s the address of default force.com template. As a result views for the same page are completely different and it`s very uncomfortale.

Are there any solutions for this problem?

Hi, everybody. I want to share my thoughts with you about the problem that I met with SOQL parser.

 

Here is the query that I tried to execute:

database.query('SELECT Id FROM Task WHERE ((AccountId IN (SELECT Id FROM Account WHERE Name like \'%test%\')) AND (ReminderDateTime > 2013-03-01T00:00:00Z)) AND (Status != \'Completed\')');

 

as a result I've got the following exception:

System.QueryException: Semi join sub-selects are only allowed at the top level WHERE expressions and not in nested WHERE expressions.

 

Let's analyze the query:

C1 = AccountId IN (SELECT Id FROM Account WHERE Name like \'%test%\')

C2 = ReminderDateTime > 2013-03-01T00:00:00Z

C3 = Status != \'Completed\'

 

Result:

... Where ((C1) AND (C2)) AND (C3)

 

 

Let's do another similar test. Everything works, if I reorganize the query in this way:

database.query('SELECT Id FROM Task WHERE (AccountId IN (SELECT Id FROM Account WHERE Name like \'%test%\')) AND (ReminderDateTime > 2013-03-01T00:00:00Z) AND (Status != \'Completed\')');

 

Analysis:

... Where (C1) AND (C2) AND (C3)

 

 

So, I can't see a real problem in the first query.

 

p.s.1: I do not exclude that this could be my error.

p.s.2: I will be very grateful for your answers, but please do not suggest to remove brackets, because this query is generated in code, and please suggest me to reorganize the query only if it's really incorrect.

Are there plans in the road map to allow custom fields on the OpportunityLineItemSchedule object?

In my case, a client would like to add another Quantity-type (double) field onto the OpportunityLineItemSchedule object.

Thanks.