-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcontroller.js
More file actions
64 lines (27 loc) · 2.1 KB
/
controller.js
File metadata and controls
64 lines (27 loc) · 2.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
var app = angular.module("serviceApp",[]);
// var app = app();
app.controller('controller', function ($scope,$window,$http) {
$http.get("https://octopusexcelacom-developer-edition.ap5.force.com/services/apexrest/Lead").success(function(response) {
$scope.json = response;
});
$scope.addName = function(){
var inputJson={"LeadType":$scope.LeadType,"Status":$scope.Status,"FirstName":$scope.FirstName,"LastName":$scope.LastName,"Rating":$scope.Rating,"BusinessPhoneNumber":$scope.BusinessPhoneNumber,"Email":$scope.Email,"WinProbability":$scope.WinProbability};
$http.post("https://octopusexcelacom-developer-edition.ap5.force.com/services/apexrest/Lead",inputJson).success(function(response) {
location.reload();
console.log("Created successfully");
});
}
$scope.updateName = function(){
var inputJson={"Id":$scope.Id,"LeadType":$scope.LeadType,"Status":$scope.Status,"FirstName":$scope.FirstName,"LastName":$scope.LastName,"Rating":$scope.Rating,"BusinessPhoneNumber":$scope.BusinessPhoneNumber,"Email":$scope.Email,"WinProbability":$scope.WinProbability};
$http.put("https://octopusexcelacom-developer-edition.ap5.force.com/services/apexrest/Lead",inputJson).success(function(response) {
location.reload();
console.log("Deleted successfully");
});
}
$scope.deleteName = function(){
$http.delete("https://octopusexcelacom-developer-edition.ap5.force.com/services/apexrest/Lead/"+$scope.Id).success(function(response) {
location.reload();
console.log("Deleted successfully");
});
}
})