我有Sample_Product__c
自定义对象,并希望使用关系字段的外部ID创建对象:
final Map<String, Object> prod = new HashMap<String, Object>();
prod.put("External_ID__c", obj.getString("medicineName"));
final Map < String, Object > sample = new HashMap < String, Object > ();
sample.put("Product__r", prod);
sample.put("LotNumber__c", obj.getString("medicineSerialNo"));
sample.put("GivenDate__c", format.format(givenDate));
sample.put("ExpiredDate__c", format.format(expireDate));
sample.put("GivenNumber__c", obj.getString("medicineQuantity"));
sample.put("Call__c", callid);
RestRequest.getRequestForCreate(getString(R.string.api_version), "Sample_Product__c", sample);
这会产生错误,Product__r should be SObject
...
在PHP中,我这样做是这样的:
$sfobject = new stdclass();
$sfobject->External_ID__c = "...";
$sample->Product__r = $sfobject;
但不知道如何使用salesforce mobile SDK实现这一目标...希望有人知道,谢谢!