• brum
  • NEWBIE
  • 0 Points
  • Member since 2012

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies

Hi,

 

I need to retrieve only deleted records from Contacts using ios to synchronize data with my ipad application. I am trying a query which I check isDeleted = true, but it doesn't work. In java api, we have a getDeleted() method to simplify our life. Someone know, what is an equivalent method or something that works fine?

 

Thanks,

brum

  • May 16, 2012
  • Like
  • 0

I am new in Salesforce and ios development. I need to download a text file and images from Salesforce (Files or Libraries) and save it on disk using ios and rest api. I am trying this code below, but it doesn't work or not complete. Please, someone help me to know :

1) What is the correct url?

2) What is object id length : 15 or 18?

3) How to get OAuth token and Authorization? I have my consumer key, login domain,...

4) The complete code like methods to handle the response, error, ...

 

    NSURL *myURL = [NSURL URLWithString:@"https://test.salesforce.com/v23.0/sobjects/ContentVersion/<objectID>/VersionData"];
    NSMutableURLRequest* requestDoc = [[NSMutableURLRequest alloc] initWithURL:myURL];
    [requestDoc addValue:@"OAuth token" forHTTPHeaderField:@"Authorization"];
    [NSURLConnection connectionWithRequest:requestDoc delegate:self];

 

Thanks,

brum

  • May 16, 2012
  • Like
  • 0

Hi,

 

I need to retrieve only deleted records from Contacts using ios to synchronize data with my ipad application. I am trying a query which I check isDeleted = true, but it doesn't work. In java api, we have a getDeleted() method to simplify our life. Someone know, what is an equivalent method or something that works fine?

 

Thanks,

brum

  • May 16, 2012
  • Like
  • 0

Hi I have tried a few option here but none seem to work, I dont know if it's because the sdk will only work with JSON data and not sure if i should go for SOAP Calls. I can list my libraries, and documents contained but cant download a document.

 

//# Option 1: Using the api factory method for the request. Of course it expects JSON return.
SFRestRequest *request = [[SFRestAPI sharedInstance] requestForRetrieveWithObjectType:@"ContentVersion" objectId:documentId fieldList: @"VersionData"];
    
     //# Option 2: Method executes but again it's expecting json return
    SFRestRequest *request = [[SFRestRequest alloc] init];
    [request setPath: @"/v23.0/sobjects/ContentVersion/[object id]/VersionData"];
    [request setMethod: SFRestMethodGET];
    [[SFRestAPI sharedInstance] send:request delegate:self];
    
    //#Option 3: get html error saying that the page doesnt exist,  could be related to the new url that needs to be set after login process, dont know how tho get it from the framework.

    NSURL *myURL = [NSURL URLWithString:@"https://test.salesforce.com/v23.0/sobjects/ContentVersion/[objectID]/VersionData"];
    NSMutableURLRequest* request = [[[NSMutableURLRequest alloc] initWithURL:myURL] autorelease];
    
    [request addValue:@"OAuth token" forHTTPHeaderField:@"Authorization"];
    [NSURLConnection connectionWithRequest:request delegate:self];

 

  • December 28, 2011
  • Like
  • 0