如何将salesforce SOQL查询中的这两个请求合并为iOS中的单个请求:
NSString *theRequest = [NSString stringWithFormat:@"SELECT Name, OpportunityID FROM OpportunityLineItem where OpportunityID = '%@'", [companyDic objectForKey:@"Id"]];
SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:theRequest];
[[SFRestAPI sharedInstance] send:request delegate:self];
和
NSString *theRequest2 = [NSString stringWithFormat:@"SELECT CompetitorName FROM OpportunityCompetitor where OpportunityID = '%@'", [companyDic objectForKey:@"Id"]];
SFRestRequest *request2 = [[SFRestAPI sharedInstance] requestForQuery:theRequest2];
[[SFRestAPI sharedInstance] send:request2 delegate:self];
答案 0 :(得分:0)
使用此子查询:
SELECT Name, OpportunityID FROM OpportunityLineItem where OpportunityID IN (SELECT OpportunityID FROM OpportunityCompetitor where OpportunityID = '%@')