You need to sign in to do that
Don't have an account?
KevinMc
Custom Formula based on Case Owner Role
I am trying to create a custom formula that takes the Case Owner Role and determines a geographical location of that Case Owner. I've tried the following, but according to Salesforce Support, the $UserRole.Name is actually the current user, not the Case Owner. Any help would be appreciated.
CASE ($UserRole.Name,"Product Support 1 (Denver)" ,"Denver",
"Product Support 2 (Denver)" ,"Denver",
"Ratings Product Support (Denver)" ,"Denver",
"Manager Client Services (Denver)" ,"Denver",
"Manager Product Support 1 (Denver)" ,"Denver",
"Manager Product Support 2 (Denver)" ,"Denver",
"Sales Inquiry (Denver)" ,"Denver",
"Manager Client Services - Europe" ,"London",
"Manager Product Support - Europe" ,"London",
"Product Support - Europe" ,"London",
"Support - Pacific" ,"Asia-Pacific",
"Support - Japan/Korea" ,"Asia-Pacific",
"Support - Asia" ,"Asia-Pacific","New York")
"Product Support 2 (Denver)" ,"Denver",
"Ratings Product Support (Denver)" ,"Denver",
"Manager Client Services (Denver)" ,"Denver",
"Manager Product Support 1 (Denver)" ,"Denver",
"Manager Product Support 2 (Denver)" ,"Denver",
"Sales Inquiry (Denver)" ,"Denver",
"Manager Client Services - Europe" ,"London",
"Manager Product Support - Europe" ,"London",
"Product Support - Europe" ,"London",
"Support - Pacific" ,"Asia-Pacific",
"Support - Japan/Korea" ,"Asia-Pacific",
"Support - Asia" ,"Asia-Pacific","New York")
2. Add a custom field "OwnerRole" to the Account object.
3. Add the s-control to the page layout of the Account object and set the width and height to 0
<script>
function loadRole() {
accountId = "{!Account.Id}";
ownerId = "{!Account.OwnerId}";
records = qOResult.getArray("records");
var oEntry = records[i];
var roleId = oEntry.UserRoleId;
}
records = qRResult.getArray("records");
var rEntry = records[i];
var name = rEntry.Name;
}
acc.id = accountId;
acc.OwnerRole__c= name;
result = sforce.connection.update([acc]);
</script>
</body>
I can't get this to work unless the Account record is refreshed in the browser AFTER clicking on it, or the record is edited in some way. Otherwise, the OwnerId field remains empty.
Any ideas?