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

Commit c2bd05f

Browse files
committed
Support RemoteTK within a namespace
Use Visualforce.remoting.Manager.invokeAction and $RemoteAction global variable so RemoteTK can be used within a managed package's namespace.
1 parent 6f9efca commit c2bd05f

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

RemoteTK.component

+8-8
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ if (remotetk.Client === undefined) {
6666
* @param [error=null] function to which jqXHR will be passed in case of error
6767
*/
6868
remotetk.Client.prototype.describe = function(objtype, callback, error) {
69-
RemoteTKController.describe(objtype, function(result){
69+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.describe}', objtype, function(result){
7070
handleResult(result, callback, error);
7171
}, {
7272
escape: false
@@ -83,7 +83,7 @@ if (remotetk.Client === undefined) {
8383
* @param [error=null] function to which jqXHR will be passed in case of error
8484
*/
8585
remotetk.Client.prototype.create = function(objtype, fields, callback, error) {
86-
RemoteTKController.create(objtype, JSON.stringify(fields), function(result){
86+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.create}', objtype, JSON.stringify(fields), function(result){
8787
handleResult(result, callback, error);
8888
}, {
8989
escape: false
@@ -100,7 +100,7 @@ if (remotetk.Client === undefined) {
100100
* @param [error=null] function to which jqXHR will be passed in case of error
101101
*/
102102
remotetk.Client.prototype.retrieve = function(objtype, id, fieldlist, callback, error) {
103-
RemoteTKController.retrieve(objtype, id, fieldlist, function(result){
103+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.retrieve}', objtype, id, fieldlist, function(result){
104104
handleResult(result, callback, error);
105105
}, {
106106
escape: false
@@ -121,7 +121,7 @@ if (remotetk.Client === undefined) {
121121
*/
122122
/*
123123
remotetk.Client.prototype.upsert = function(objtype, externalIdField, externalId, fields, callback, error) {
124-
RemoteTKController.upser(objtype, externalIdField, externalId, JSON.stringify(fields), function(result){
124+
Visualforce.remoting.Manager.invokeAction('$RemoteAction.RemoteTKController.upser', objtype, externalIdField, externalId, JSON.stringify(fields), function(result){
125125
handleResult(result, callback, error, true);
126126
}, {
127127
escape: false
@@ -140,7 +140,7 @@ if (remotetk.Client === undefined) {
140140
* @param [error=null] function to which jqXHR will be passed in case of error
141141
*/
142142
remotetk.Client.prototype.update = function(objtype, id, fields, callback, error) {
143-
RemoteTKController.updat(objtype, id, JSON.stringify(fields), function(result){
143+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.updat}', objtype, id, JSON.stringify(fields), function(result){
144144
handleResult(result, callback, error, true);
145145
}, {
146146
escape: false
@@ -156,7 +156,7 @@ if (remotetk.Client === undefined) {
156156
* @param [error=null] function to which jqXHR will be passed in case of error
157157
*/
158158
remotetk.Client.prototype.del = function(objtype, id, callback, error) {
159-
RemoteTKController.del(objtype, id, function(result){
159+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.del}', objtype, id, function(result){
160160
handleResult(result, callback, error, true);
161161
}, {
162162
escape: false
@@ -171,7 +171,7 @@ if (remotetk.Client === undefined) {
171171
* @param [error=null] function to which jqXHR will be passed in case of error
172172
*/
173173
remotetk.Client.prototype.query = function(soql, callback, error) {
174-
RemoteTKController.query(soql, function(result){
174+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.query}', soql, function(result){
175175
handleResult(result, callback, error);
176176
}, {
177177
escape: false
@@ -186,7 +186,7 @@ if (remotetk.Client === undefined) {
186186
* @param [error=null] function to which jqXHR will be passed in case of error
187187
*/
188188
remotetk.Client.prototype.search = function(sosl, callback, error) {
189-
RemoteTKController.search(sosl, function(result){
189+
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.search}', sosl, function(result){
190190
handleResult(result, callback, error);
191191
}, {
192192
escape: false

0 commit comments

Comments
 (0)