Skip to content
This repository was archived by the owner on Jan 10, 2024. It is now read-only.
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion RemoteTK.component
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ if (remotetk.Client === undefined) {
* @param [error=null] function to which jqXHR will be passed in case of error
*/
remotetk.Client.prototype.upsert = function(objtype, externalIdField, externalId, fields, callback, error) {
Visualforce.remoting.Manager.invokeAction('$RemoteAction.RemoteTKController.upser', objtype, externalIdField, externalId, JSON.stringify(fields), function(result){
Visualforce.remoting.Manager.invokeAction('{!$RemoteAction.RemoteTKController.upser}', objtype, externalIdField, externalId, JSON.stringify(fields), function(result){
handleResult(result, callback, error, true);
}, {
escape: false
Expand Down
18 changes: 9 additions & 9 deletions RemoteTKController.cls
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
* POSSIBILITY OF SUCH DAMAGE.
*/

public class RemoteTKController {
global class RemoteTKController {
private static String makeError(String message, String errorCode) {
JSONGenerator gen = JSON.createGenerator(false);
gen.writeStartArray();
Expand Down Expand Up @@ -107,7 +107,7 @@ public class RemoteTKController {
}

@remoteAction
public static String describe(String objtype) {
global static String describe(String objtype) {
// Just enough to make the sample app work!
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objtype);
if (targetType == null) {
Expand Down Expand Up @@ -145,7 +145,7 @@ public class RemoteTKController {
}

@remoteAction
public static String create(String objtype, String fields) {
global static String create(String objtype, String fields) {
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objtype);
if (targetType == null) {
return makeError('The requested resource does not exist', 'NOT_FOUND');
Expand Down Expand Up @@ -180,7 +180,7 @@ public class RemoteTKController {
}

@remoteAction
public static String retrieve(String objtype, String id, String fieldlist) {
global static String retrieve(String objtype, String id, String fieldlist) {
// TODO - handle null fieldlist - retrieve all fields
Boolean containsId = false;
for (String field : fieldlist.split(',')) {
Expand All @@ -206,7 +206,7 @@ public class RemoteTKController {
}

@remoteAction
public static String upser(String objtype, String externalIdField, String externalId, String fields) {
global static String upser(String objtype, String externalIdField, String externalId, String fields) {
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objtype);
if (targetType == null) {
return makeError('The requested resource does not exist', 'NOT_FOUND');
Expand All @@ -228,7 +228,7 @@ public class RemoteTKController {
}

@remoteAction
public static String updat(String objtype, String id, String fields) {
global static String updat(String objtype, String id, String fields) {
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objtype);
if (targetType == null) {
return makeError('The requested resource does not exist', 'NOT_FOUND');
Expand Down Expand Up @@ -258,7 +258,7 @@ public class RemoteTKController {
}

@remoteAction
public static String del(String objtype, String id) {
global static String del(String objtype, String id) {
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(objtype);
if (targetType == null) {
return makeError('The requested resource does not exist', 'NOT_FOUND');
Expand All @@ -283,7 +283,7 @@ public class RemoteTKController {
}

@remoteAction
public static String query(String soql) {
global static String query(String soql) {
List<sObject> records;
try {
records = Database.query(soql);
Expand All @@ -300,7 +300,7 @@ public class RemoteTKController {
}

@remoteAction
public static String search(String sosl) {
global static String search(String sosl) {
List<List<SObject>> result;
try {
result = Search.query(sosl);
Expand Down