-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhome.html
More file actions
45 lines (40 loc) · 1.59 KB
/
home.html
File metadata and controls
45 lines (40 loc) · 1.59 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
<html>
<meta http-equiv="cache-control" content="no-cache" />
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
<table style="border:solid;"></table>
<script>
window.onload = function() {
var $ = jQuery.noConflict();
var authToken = decodeURI(window.location.href.split('=')[1].split('&')[0]);
// Make a soql call to get list of Bouquets
$.ajax({
type : 'GET',
url : 'https://eu8.salesforce.com/services/data/v43.0/query?q=' +
'Select Id, Deliver_To__c, Delivery_Date__c, Message__c FROM Bouquet__c',
headers : {
'Authorization' : 'Bearer ' + authToken,
'Content-Type' : 'application/json'
},
success : function(result) {
// Build header
var tableHeader = '<thead><tr>' +
'<th>Deliver To</th>' +
'<th>Deliver Date</th>' +
'<th>Deliver Message</th>' +
'</tr></thead>';
// Build rows
var tableRows = '<tbody>';
$.each(result.records, function(i, rec) {
tableRows += '<tr>';
tableRows += '<td>' + rec.Deliver_To__c + '</td>';
tableRows += '<td>' + rec.Delivery_Date__c + '</td>';
tableRows += '<td>' + rec.Message__c + '</td>';
tableRows += '</tr>';
});
tableRows += '</tbody>';
$('table').append($(tableHeader + tableRows));
}
});
}
</script>
</html>