X

It's All About the Platform.

All About The Resource Object

Richard Bingham
Senior Development Manager

This article looks in detail at the Resource object available in Oracle Sales Cloud. It has been created to aid the understanding on how this Common Standard Object can be used in customization and extension projects.

What Is A Resource?

A Resource is a HCM person (which may or may not be a User that can log in) identified as a participant in the Sales application, and as such can be assigned to business objects. An example might be a member of an Opportunity team or an Account owner.

Resource Setups

This extra ‘identification’ is done during the HCM person provisioning step, under which a Resource Role is selected and gets applied as the internal HR Assignment Status becomes active.  The User Details page below shows the Employment Information used in HCM together with the Resource Information section used by Oracle Sales Cloud to identify this additionally as a resource record.

The Resource Roles (such as Sales Administrator or Sales
Manager) are then used to build a hierarchy under which the Sales functionality
will operate.  The creation of a Resource
Organization hierarchy is detailed in the Oracle documentation, and outside the focus of this document.

Also in the Manage Users page, under ‘Autoprovision Roles’ there is also a dedicated 'Resource' job role. It is this, in combination
to a Resource Roles for use in an Organization Hierarchy, define the User
as a Resource record. The 'Resource' job role ensure access to the Resource Directory pages, as shown below.

Additional Resource Roles can be added, with Manager or Member as the main types used in the hierarchy.  This is done using the "Manage Resource Roles" task from Setup and Maintenance through the following edit role screen:

Customizing a Resource Record

As with all Standard Objects, custom fields can be added to
the Resource. In the example below a custom checkbox entitled “Event Organizer”
has been added. Resource details, and therefore their Custom fields, are
exposed on the Resource Directory -
Resource Details
page.

Note that this is a Desktop UI page and there is no
equivalent simplified UI page for Resource details. The page layout still
allows all types of custom field and sub-tabs for related/child objects also.

File-based Resource Administration

The ‘Employee Resource’ import object is available for defining
Resources from a file. This is an extension to the standard import of HCM workers
(and users) but relies on the same HCM file-based loader. Read more about using
this
here
.

The file-based loader import (and export) can be very useful in
data migration, and supports the population of custom fields added to the
object (after the object ‘generation’ process to update the import object
definition).

As shown below the mapping within the import requires the
use of multiple target internal objects – with Worker Profile and Resource
Profile
as required (linking the HCM Person to the Resource Role), plus
optional data for Address, Resource Organization, and Resource Team.

The Resource SOAP Services

To interact with Resource records using SOAP-based web services there are two options:

TheSalesAccountResourceService.
This allows the management of Resource records that are associated to one
specific Account. Exposes attributes including; PartyName, RoleName,
ResourcePrimaryOrgName, SalesAccountPartyId, ResourceId (same as PartyId),
SalesAccountPartyId (the PartyId of one specific Account). The service has
find, create, update, and delete operations, however is in context of a particular
Sales Account (customer) therefore these requests also require ResourceId
and SalesAccountId (along with LockAssignmentFlag). Read
more about this
here
.
The WSDL at:

  • http://crm-[YourHost]/crmCommonSalesParties/SalesAccountResourceService?WSDL

The ResourceService. This allows
standalone management of Resource records. The service has find, create,
update, and delete operations. It accepts the Resource
SDO
, along with related objects. Read more about this
here
. The WSDL can be found at:

  • http://crm-[YourHost]/foundationResources/ResourceService?WSDL

Reminder: All customizations need to be published from their
sandbox before they will be available in SOAP web services.

The Resource RESTful service

It is also possible to interact with Resource records using
the REST-based web service. The 'resources' RESTful resource provides GET
operations for querying one or all resource records. At this time the service
does not support create, update or delete. The service is available at:

  • http://crm-[YourHost]/crmCommonApi/resources/11.1.11/resources

This exposes attributes including: PartyId (also used to get
individual records), PartyName, PartyNumber, ResourceProfileId, ResourceType, Usage,
and all custom fields. Read more about it here.

Resource Groovy Examples

The following provides some illustrative examples of interacting
with Resource records within Application Composer groovy scripts.

a) Find and update the current users resource record

 
def myID = adf.util.getUserPartyId()
def vo = newView('Resource')
def searchExpression = "PartyId = " + myID
vo.appendViewCriteria(searchExpression)
vo.executeQuery()
def oneItem = vo.first()
oneItem.setAttribute('EventOrganizer_c',"Y")
 
 

b) Query and update a subset of resource records

def vo = newView('Resource')
def searchExpression = "Manager ='jjefferson'"
vo.appendViewCriteria(searchExpression )
vo.executeQuery()
while(vo.hasNext()){
  def oneItem = vo.next()
  oneItem.setAttribute('EventOrganizer_c',"Y") }

 

c) Query all resource records and conditionally update some

def vo = newView('Resource')
vo.executeQuery()
while(vo.hasNext()){
 def oneItem = vo.next()
 if(oneItem.PrimaryOrganization =='Global Organization'){
  oneItem.setAttribute('EventOrganizer_c',"Y") } } 

Note that for performance reasons it is recommended to
query a subset of Resource records and update those (b) rather than query all
records and iterate what could be a massive dataset (c).

The Resource Object Attributes

Similar to our cheatsheet
for other Sales Cloud Objects, this section provides a list of all the
available attributes (fields) for the Resource standard object.

Join the discussion

Comments ( 2 )
  • guest Monday, January 23, 2017

    We have to import OSC Opportunity from SFDC. Client does not know the OSC owner id, so we thought of creating a custom field in the Resource Directory and stamp it with SFDC owner Id value and use the same to get the corresponding Opportunity Owner value.

    Issue we are facing is the Opportunity Attribute Mapping does not include the custom field created on Resource Directory.

    How do we overcome this issue?


  • Yerra Mounika Monday, August 13, 2018
    Hi
    I want to get resource role of logged in users in OSC, based on the resource role i want to assign some value to custom object.
    How do i do that using groovy or webservice.
Please enter your name.Please provide a valid email address.Please enter a comment.CAPTCHA challenge response provided was incorrect. Please try again.