You need to sign in to do that
Don't have an account?
NMISHRA
zksForceClient search method sample?
Hi,
Is there a sample code snippet of using the search method of the zksForceClient when it returns objects of multiple types(like Account, Contact and others)?
Thanks in advance and regards
You can't compare object points to compare string values, you need to use the isEqualToString: method on NSString. e.g. if ([[r type] isEqualToString:@"Contact"]) { // do something }
All Answers
Thanks for quick response! A small sample code snippet will really help...
Regards
NSArray *res = [client seach:someSosl];
for (ZKSObject *r in res) {
NSLog(@"result is a %@", [r type]);
}
Maildrop uses search, see the who/what search code in https://github.com/superfell/maildrop/blob/master/maildrop/CreateActivityController.m
Thanks. I want to check the type of object whether it is a Contact, Account or any other. However, the following check fails:
if
( [r type] == @"Contact")
{
NSLog(@"%@", [ r valueForKey:@"Id"]);
}
even though I see the object is a Contact object in the XCode watch window.
May be I'm missing something simple...
You can't compare object points to compare string values, you need to use the isEqualToString: method on NSString. e.g. if ([[r type] isEqualToString:@"Contact"]) { // do something }
That was it...thanks!
Is it possible to use NSPredicate?
Not directly, if you wanted a challenge you could write something to generate soql or sosl from an NSPredicate.