assignUserByLocation

  • boolean assignUserByLocation(address, includeSubGroups, currentGroup)

This method uses a location-based assigner to assign an assignable entity based on a given address. This is useful, for example, in the assignment of adjusters and accident appraisers, which is often done based on geographical territory ownership.

If no user matches the criteria specified by the method, the method assigns the item to the item owner. For example, if the method cannot determine a user from the supplied criteria, it assigns an activity to the owner of the policy associated with the activity.

The method matches users first by zip, then by county, then by state. The first match wins. If one or more users match at a particular location level, then assignment performs round-robin assignment through that set, ignoring any matches at a lower level. For example, suppose the method finds no users that match by zip, but a few that match by county. In this case, the method performs round-robin assignment through the users that match by county and it ignores any others that match by state.

The assignUserByLocation method bases persistence in the round-robin assignment state on the specified location information. For this reason, it is preferable to use a partially completed location, such as one that includes only the zip code, rather than a specific house.

The following example assigns a user based on the primary location of the account associated with the activity.
Activity.assignUserByLocation(Activity.Account.PrimaryLocation.Address, false, 
      Group( "default_data:1" /* Default Root Group */ ) )