0
votes

I have faced one error while requesting Salesforce Rest API iOS Platform.

Please find below Query:

SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:[NSString stringWithFormat:@"SELECT Id, Name, Total_Distance__c, AccountId, Account.Name,Account.Flag_Url__c FROM Contact WHERE Wants_Privacy__c = false AND Id IN %@ ORDER BY Total_Distance__c DESC LIMIT 200",arrayCompetitionEntities]];

[[SFRestAPI sharedInstance] send:request delegate:self];

here %@ will be replaced by an array "arrayCompetitionEntities" that is ( 00326000003GW1sAAG, 00326000003GW4NAAW )

Now while requesting this query with salesforce rest API, I have found one issue could you please let me know the issue if possible?.

Error:

Error Domain=CSFNetworkErrorDomain Code=400 " 00326000003GW1sAAG, ^ ERROR at Row:2:Column:15 expecting a right parentheses, found 'GW1sAAG'" UserInfo={action=, NSLocalizedFailureReason=MALFORMED_QUERY, NSLocalizedDescription= 00326000003GW1sAAG, ^ ERROR at Row:2:Column:15 expecting a right parentheses, found 'GW1sAAG', isAuthenticationFailure=false}

1

1 Answers

0
votes

The Ids need to be quoted, i.e. you need to generate this for your replacement value

( '00326000003GW1sAAG', '00326000003GW4NAAW' )