Skip to main content
edited body
Source Link
TehNrd
  • 793
  • 7
  • 15

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. BelwoBelow is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Below is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

Tweeted twitter.com/#!/StackSalesforce/status/337025791021940736
removed sig
Source Link
Daniel Blackhall
  • 8k
  • 10
  • 51
  • 68

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

Thanks, Jason

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

Thanks, Jason

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

edited body
Source Link
TehNrd
  • 793
  • 7
  • 15

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

isIs this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

Thanks, Jason

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

Thanks, Jason

When running a report and if Account Teams are enabled you have an option to search "My Account Team and My Accounts". This returns accounts in which you are listed on the sales team or you are the account owner. Belwo is the SOQL and error I am recieving:

List<Account> acc = [SELECT Id FROM account WHERE Id IN (SELECT accountId FROM accountteammember WHERE UserId = :UserInfo.getUserId()) OR ownerid = :UserInfo.getUserId()];

Error: Semi join sub-selects are not allowed with the 'OR' operator

Is this a dead end? Any ideas how this could be accomplished with SOQL....or maybe even without SOQL.

Thanks, Jason

Source Link
TehNrd
  • 793
  • 7
  • 15
Loading