Last active
August 29, 2015 14:18
-
-
Save CraigCav/fe4650c2635e71828735 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trigger WellDepthNotification on FX5__Job__c (after update) { | |
for(FX5__Job__c job: Trigger.New) | |
{ | |
if(job.Well_Depth__c > 50) | |
{ | |
Messaging.PushNotification msg = new Messaging.PushNotification(); | |
String userId = job.OwnerId; | |
Set<String> users = new Set<String>(); | |
users.add(userId); | |
Map<String, Object> payload = new Map<String, Object>(); | |
payload.put('message', 'Well depth set to ' + job.Well_Depth__c); | |
payload.put('url', URL.getSalesforceBaseUrl().toExternalForm() + '/' + job.Id); | |
msg.setPayload(payload); | |
msg.send('Android_Wear_Demo', users); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment