Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.

Commit 35397b1

Browse files
author
Pat Patterson
committed
Merge pull request #25 from cwarden/remotetk-forcetk-compatibility
Improve compatiblity of RemoteTK with ForceTK
2 parents 5548cf8 + a116718 commit 35397b1

File tree

2 files changed

+15
-0
lines changed

2 files changed

+15
-0
lines changed

RemoteTK.component

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,12 @@ if (remotetk.Client === undefined) {
5757
*/
5858
remotetk.Client = function(){
5959
}
60+
61+
/** NOOP: for compatibility with forcetk
62+
*/
63+
remotetk.Client.prototype.setSessionToken = function() {}
64+
remotetk.Client.prototype.setRefreshToken = function() {}
65+
remotetk.Client.prototype.setUserAgentString = function() {}
6066

6167
/*
6268
* Completely describes the individual metadata at all levels for the

RemoteTKController.cls

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,13 @@ public class RemoteTKController {
4545
field.put('type', descField.getType().name().toLowerCase());
4646
field.put('name', descField.getName());
4747
field.put('label', descField.getLabel());
48+
List<String> references = new List<String>();
49+
for (Schema.sObjectType t: descField.getReferenceTo()) {
50+
references.add(t.getDescribe().getName());
51+
}
52+
if (!references.isEmpty()) {
53+
field.put('referenceTo', references);
54+
}
4855

4956
fields.add(field);
5057
}
@@ -236,6 +243,8 @@ public class RemoteTKController {
236243

237244
Map<String, Object> result = new Map<String, Object>();
238245
result.put('records', records);
246+
result.put('totalSize', records.size());
247+
result.put('done', true);
239248

240249
return JSON.serialize(result);
241250
}

0 commit comments

Comments
 (0)