Question

I know how to create relation:

QBCustomObject customObject = new QBCustomObject("Comment"); // your Class name
customObject.put(fieldHealth, 99);
customObject.put("text", "The first film in the series was...");
customObject.setParentId("50aa4d8fefa357fa14000001");

QBCustomObjects.createObject(qbCustomObject, new QBCallbackImpl() {
@Override
public void onComplete(Result result) {
    if (result.isSuccess()) {
        QBCustomObjectResult qbCustomObjectResult = (QBCustomObjectResult) result;
        QBCustomObject qbCustomObject = qbCustomObjectResult.getCustomObject();
        Log.d("New record: ",newCustomObject.toString());
    } else {
        Log.e("Errors",result.getErrors().toString());
    }
}
});

But, how to retrieve when i have the parent id?

Was it helpful?

Solution

You should do a separate request for this:

QBCustomObjectRequestBuilder requestBuilder = new QBCustomObjectRequestBuilder();
requestBuilder.eq("_parent_id", "50aa4d8fefa357fa14000001");

QBCustomObjects.getObjects(CLASS_NAME, requestBuilder, new QBCallbackImpl(){...
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top