Skip to content

Instantly share code, notes, and snippets.

@reuf
Forked from martyychang/SetNewOwner.trigger
Created December 20, 2015 23:09
Show Gist options
  • Save reuf/ed90c72c4a9c858da0c4 to your computer and use it in GitHub Desktop.
Save reuf/ed90c72c4a9c858da0c4 to your computer and use it in GitHub Desktop.
Trigger to enable users to change the Case Owner through a proxy field via a publisher action in Salesforce1
trigger SetNewOwner on Case (before insert, before update) {
for (Case eachCase : Trigger.new) {
if (eachCase.NewOwner__c != null) {
eachCase.OwnerId = eachCase.NewOwner__c;
eachCase.NewOwner__c = null;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment