Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
VFRO vs VFRA
module.exports = function(ngModule) {
if (ON_TEST) {
require('./mappingWizard.test')(ngModule);
}
ngModule.factory('FolderFieldFactory', ['$q', function($q) {
return function(objectName) {
var deferred = $q.defer();
Visualforce.remoting.Manager.invokeAction(
configSettings.remoteActions.getFields,
objectName,
function(result, event) {
if (event.status) {
deferred.resolve(result);
} else {
deferred.reject(event);
}
}, {
buffer: true,
escape: false,
timeout: 30000
}
);
return deferred.promise;
};
}]);
ngModule.factory('FolderTypeFactory', ['$q', function($q) {
return function(objectName) {
var deferred = $q.defer();
Visualforce.remoting.Manager.invokeAction(
configSettings.remoteActions.getTypes,
objectName,
function(result, event) {
if (event.status) {
deferred.resolve(result);
} else {
deferred.reject(event);
}
}, {
buffer: true,
escape: false,
timeout: 30000
}
);
return deferred.promise;
};
}]);
ngModule.factory('TreeDataFactory', ['$q', function($q) {
return function(objectName) {
var deferred = $q.defer();
var ct = new CustomSettings.EOS_Type__c();
ct.retrieve({
limit: 100
},
function(err, records) {
if (err) {
deferred.reject(err);
} else {
deferred.resolve(records);
}
}
);
// Visualforce.remoting.Manager.invokeAction(
// configSettings.remoteActions.getTreeData,
// function(result, event) {
// if (event.status) {
// } else {
// }
// }, {
// buffer: true,
// escape: false,
// timeout: 30000
// }
// );
return deferred.promise;
};
}]);
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment