function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
JohnC5674JohnC5674 

S-Control

Hello everyone,
 
I'm not familiar with scontrols at all and need help on something.  When users create cases, we have no way to know what market or territory that users is from so we can't create reports to show the number of cases created by territory or market.  Is there a way to create a field and inline scontrol so that anytime a user creates a case, it will populate with what is in the Territory field on the user record? 
 
 
CaptainObviousCaptainObvious
Try creating a new formula field in Setup > App Setup > Cases > Fields
 
Make the formula a text type, and use something like:
 
$User.Territory
 
(I'm assuming "Territory" is a valid field in the user table).
JohnC5674JohnC5674

Captain Obvious,

Thanks for the quick reply.  I tried your suggestion but its giving me an error "Error: Field User.Territory__c does not exist. Check spelling."?? Any suggestions?

CaptainObviousCaptainObvious

Where is your Territory field located?

JohnC5674JohnC5674
Territory is located on the user object.  Setup > App Setup > Users> Fields (Custom Field).  I am needing it on the Case object.  I did find a way by creating a text field and on the default value using a case formula of CASE( $User.Territory__c , "Alabama", "Alabama", "Appalachians", "Appalachians","Central Arkansas", "Central Arkansas", "Central Virginia", "Central Virginia","Charlotte/Hickory", "Charlotte/Hickory", "Cleveland", "Cleveland","Coastal SC", "Coastal SC", "Columbia/Greenville", "Columbia/Greenville","Columbus", "Columbus", "East/Central TX", "East/Central TX","Grand Rapids/N MI", "Grand Rapids/N MI", "Hampton Roads/Richmond", "Hampton Roads/Richmond","Illinois/NE AR", "Illinois/NE AR", "Kansas", "Kansas","Lubbock", "Lubbock", "MS / S LA", "MS / S LA","MT/WY/ID", "MT/WY/ID", "NC Triad", "NC Triad","ND/Minnesota", "ND/Minnesota", "Nebraska", "Nebraska","NM/S CO", "NM/S CO", "NW AR/Missouri", "NW AR/Missouri","NW Florida", "NW Florida", "NW Ohio", "NW Ohio","Ohio Valley", "Ohio Valley", "Oklahoma", "Oklahoma","Phoenix A", "Phoenix A", "Phoenix B", "Phoenix B","Raleigh", "Raleigh","S AR/N LA", "S AR/N LA","Savannah/Jax", "Savannah/Jax","S AZ/Nevada", "S AZ/Nevada","S Florida", "S Florida","South Dakota", "South Dakota","South NC", "South NC","Tampa", "Tampa","Wisconsin", "Wisconsin","W TX/S NM", "W TX/S NM","ABC", "ABC", "")
 
I am guessing this will only populate when an order is created? And that the user its referring to is the Created By User? Does this sound correct?
sfdcfoxsfdcfox
That'll work, actually, since default values are applied only when creating the record. A field update would also do this. And yes, the creator of the record will be where the territory is pulled from, since $User refers to the user performing the action.