[英]Execute SalesForce SOQL queries synchronously using iOS MobileSDK
[英]How to Select from two tables in 1 query in Salesforce SOQL iOS
我如何將Salesforce SOQL查詢中的這兩個請求合並為iOS中的1個單個請求:
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];
使用此子查詢:
SELECT Name, OpportunityID FROM OpportunityLineItem where OpportunityID IN (SELECT OpportunityID FROM OpportunityCompetitor where OpportunityID = '%@')
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.