Skip to content

Instantly share code, notes, and snippets.

@martyychang
Last active December 20, 2015 23:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save martyychang/5c8f3810c3edadfbd9ad to your computer and use it in GitHub Desktop.
Save martyychang/5c8f3810c3edadfbd9ad 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;
}
}
}
@mattryanwest
Copy link

You are awesome!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment