function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
mocompmocomp 

Master-Detail object access through REST API on IOS

I have a native IOS App created using forceios. I have many objects on salesforce. I am able to access the independent objects using REST API.  But I am not able to access the Master-Detail object using the same method. How can I access the Master-Detail object using REST API on IOS

Thanks
 
mocompmocomp
In other words I would like to know how to use REST API on IOS to retrieve child records

I am using this code to access an independent object. I tried to change the option to query. Couldnt get it work. Any advise would be very helpful.

SFRestRequest *request = [[SFRestAPI sharedInstance] requestForQuery:@"SELECT NAME, Id, Testing_IOS_Display__c FROM Employee_Info__c LIMIT 10"];
    [[SFRestAPI sharedInstance] send:request delegate:self];
Gaurav KheterpalGaurav Kheterpal
The Mobile SDK simply provides a REST API for your SOQL queries. As long as your query is correctly fetching the master-detail fields, it should work fine in your iOS app. I would recommend you try checking the validity of your query using a tool such as Workbench or Force.com explorer and then including it in your iOS code. Hope that helps.

If my answer helps resolve your query, please mark it as the 'Best Answer' & upvote it to benefit others and improve the overall quality of Discussion Forums.

Gaurav Kheterpal

Developer Forums Moderator| Certified Force.com Developer| Dreamforce Speaker| Salesforce Mobile Evangelist