You need to sign in to do that
Don't have an account?
Judy
Formulas to assign user role
Hi
I'm trying to create a formula for below, but can't seem to get it working..
Any help is appreciated!
Owner role = Asia Sales; assign Region field to Asia
Owner role = ANZ Sales; assign Region field to ANZ
Owner role = ANZ Managing Director, assign Region field to ANZ
Owner role = China Sales; assign Region field to China
Owner role = China Sales Management; assign Region field to China
Owner role = China Managing Director, assign Region field to China
Owner role = Japan Sales; assign Region field to Japan
Owner role = Japan Sales Management; assign Region field to Japan
Owner role = Japan Managing Director, assign Region field to Japan
Thanks, Judy
CASE(
($UserRole.Name),
"ANZ MD","ANZ",
"ANZ Consulting Manager","ANZ",
"ANZ Marketing","ANZ",
"ANZ Presales", "ANZ"
"ANZ Sales Management","ANZ",
"ANZ Sales", "ANZ"
"Asia MD", "Asia"
"Asia Consulting Manager", "Asia"
"Asia Marketing", "Asia"
"Asia Presales", "Asia"
"Asia Sales", "Asia"
"China MD", "China"
"China Consulting Manager", "China"
"China Sales Management", "China"
"China Sales", "China"
"India MD", "India"
"India Presales", "India"
"India Sales", "India"
"Japan MD", "Japan"
"Japan Consulting Manager", "Japan"
"Japan Sales Management", "Japan"
"Japan Sales", "Japan", "")
Judy it looks like a number of commas (,) are missing:
Is this being done in a formula field or in a workflow field update?
The $UserRole.Name actually evaluates the current user not the role of another user attached to the record.
below formula will help me; but its exceeding the character limits in SF ..:smileymad:
any idea how this can be further shortened.. thanks!
IF(OwnerId = "005200000010QOE", "ANZ",
CASE(OwnerId,
"005200000010QOE", "ANZ",
Message Edited by KC-CRM Analyst on 09-17-2008 11:52 PM
no luck ... still have the Error: Compiled formula is too big to execute (8,187 characters). Maximum size is 5,000 characters
Something you might try to get around the compile size issue. It is certainly not less complicated though. You will need a text field in opportunity for each region (Region ANZ, Region Asia, etc.) These fields would not be placed on the page layout they are place holders that would be used in a Region formula field.
The placeholder fields would be updated by workflow, and a number of field updates (one for each region) that would trigger each time an opportunity record is edited/saved. You would use criteria like Opportunity Name Not Equal to (blank).
The formula field would evaluate the vales in these "intermediate" fields to determine region and would be on the page layout.
Caveat - I have not tested this but you may want to try it depending on your need.
This is an example of 2 field update formulas:
for Region ANZ:
for Region Asia:
This is an example Region Formula field:
The above example with 2 regions you would need to extend to the number you have. What is does is check if there is a value in the intermediate fields and if so that is the value of Region. It does assume that once the region is set based on the ownerid/workflow filed update it will not change.
I withdraw this part of my last post:
"It does assume that once the region is set based on the ownerid/workflow field update it will not change."
because the workflow field update should handle that situation.
OK, lets rethink this from the start. I don't think that basing the formula on the Owner ID is a good idea.
Lets just start with the ANZ group. Do they create their own records?
OK, I think this way way over thought.
You know which users are going to create in which Regions and you are trying to set it by a formula. Why not control it from the user record. Make it an editable field because it won't be controlled by owner instead it will be a default value.
You place a UserUser.User Region on the user record. If you create Region__c with a Default value of $User.User_Region__c and you have an editable default filled by the creator's Region.
It won't actually be the User.User_Region__c field it will be a text copy of the User.User_Region__c field.
You will be able to pull it on the opportunity report and if you use a formula field on the Opportunity Product to pull it down from the Opportunity you can report on it there as well. This is like Work-flow Rules Low Carb style.