PSA Apex API Developer Reference

pse.ResourceSearchService

global with sharing class ResourceSearchService implements API

A service that Queries the Resource (Contact) object using filters for security controls, region/practice/group, skills, utilization, and others.

Methods

execute

global static List<Contact> execute(pse.ResourceSearchService.ResourceSearchFilter filter)

The execute method searches for resources that meet the supplied criteria. Note if the search criteria use encrypted fields, the results cannot be sorted or filtered and an error displays.

Input Parameters

Name Type Description
filter pse.ResourceSearchService.ResourceSearchFilter An instance of the ResourceSearchService.ResourceSearchFilter class that supplies the search criteria.

Return Value

Returns a list of Contact records with the requested fields and skills, and optionally additional utilization related fields.

Sample Code

//Note: This sample code is for demonstration purposes only. It is not intended for
//use in a production environment, is not guaranteed against defects or errors, and
//is in no way optimized or streamlined.

    
/*
  Declare an instance of the class used to define the resource search API execute method criteria.
*/
pse.ResourceSearchService.ResourceSearchFilter rsf = new pse.ResourceSearchService.ResourceSearchFilter(); 


/*
    ******************************************
    ******** Security Related Options ********
    ******************************************
*/

/*
The disbleSharingModel option enables bypassing the sharing model on objects involved in the API Call.  For example, Contact, Assignments, Resource Requests, Utilization Engines, Skills, Skill Ratings, and others.    
Set to true to run the API "without sharing" and retrieve records even if the sharing model restricts the record visibility for the user. 
Set to false for the API to respect the sharing model.
*/
rsf.disableSharingModel = true;

/*
The disableSecurityOnReturnedData option bypasses the CRUD/FLS on objects that are involved in the query for objects or fields that are returned in the results.  For example, Contact, Assignments, Resource Requests, Utilization Engines, Skills, Skill Ratings, and others.    
Set to true to run the API to skip enforcement of CRUD/FLS permission, and retrieve data even if the permissions restrict the record visible for the user.
Set to false for the API to respect CRUD/FLS permissions.
*/
rsf.disableSecurityOnReturnedData = true;

/*
The disableSecurityOnSearchCriteria option bypasses the CRUD/FLS on objects involved in the query for objects or fields used to filter the results. For example, Contact, Assignments, Resource Requests, Utilization Engines, Skills, Skill Ratings, and others. 
Set to to true causes the API to skip enforcement of CRUD/FLS permission and retrieve data even if the permissions restrict the record visible for the user.
Set to false for the API to respect CRUD/FLS permissions.
*/
rsf.disableSecurityOnSearchCriteria = true;

/*
The applyStaffingPermissionControls option restricts the search to resources for which the user has staffing rights based on the PSA permission controls.  
Set to true to restrict search results to resources that the user can create assignments for, based on PSA permission controls.  
Set to false for the API to ignore staffing permission controls.
For more information on staffing rights, see PSA Permission Controls in the PSA Online Help.  If you are developing a UI to create resource assignments, 
*/
rsf.applyStaffingPermissionControls = false;



/*
    *****************************************
    ******** Results Related Options ********
    *****************************************
/*

/*
    Use the fieldsToSelect parameter to specify which fields on Contact to return.
*/
Set<String> flds = new Set<String>{'FirstName','LastName','Fax','Email','pse__Is_Resource__c','pse__Resource_Role__c','Account.Name'};
rsf.fieldsToSelect = flds;

/*
    Use the skillsToSelect parameter to specify which Skills should have information (Skill Ratings) returned as part of the results.
    This is not a filter operation.  You can return information about skills independent from if they are filtered on or not.
    The Skill Rating records pertaining to the requested skills are returned as a sub-query of the contacts. 
*/
set<ID> skillIds = new set<ID>();
set<String> mySkills = new set<String>{'warp manifold maintenance','holodeck programming','dilithium recrystallization','replicator repair'};
List<pse__Skill_Certification__c> skills = [SELECT ID FROM pse__Skill_Certification__c WHERE Name IN :mySkills];
for (pse__Skill_Certification__c s : skills){skillIds.add(s.Id);}
rsf.skillsToSelect = skillIds;


/*
   Use the assignments parameter to retrieve information about each resource's assignments as a sub query.
*/
pse.ResourceSearchService.Assignments asmts = new pse.ResourceSearchService.Assignments();
asmts.startDate = Date.Today();
asmts.endDate = Date.Today().addDays(30);
asmts.maxReturned = 10;
asmts.includeBillable = true;
asmts.includeNonbillable = true;
asmts.includeCredited = true;
asmts.includeExcluded = true;
asmts.includeExcludedFromPlanners = true;
asmts.fields = new Set<String>{'Id','Name','pse__Start_Date__c','pse__End_Date__c'};
rsf.assignments = asmts;


/*
   Use the requests parameter to retrieve information about each resource's resource requests as a sub query.
*/
pse.ResourceSearchService.ResourceRequests rrs = new pse.ResourceSearchService.ResourceRequests();
rrs.startDate = Date.Today();
rrs.endDate = Date.Today().addDays(30);
rrs.useScheduleDates = true;
rrs.includeRequestsWithoutSchedules = true;
rrs.includeRequestsThatBecameAssignments = false;
rrs.maxReturned = 10;
rrs.includeExcludedFromPlanners = true;
rrs.fields = new Set<String>{'Id','Name','pse__Start_Date__c','pse__End_Date__c'};
rsf.requests = rrs;



/*
    Use the orderByFields parameter to control the ordering of the search results.
*/
List<String> orderby = new List<String>{'Name'};
rsf.orderByFields = orderBy;

/*
    Use the "maxReturnedResults" parameter to limit the results to a specific number of returned records.
    The default value is 10000.
*/
rsf.maxReturnedResults = 999;




/*
    *****************************************
    ******* Filtering Related Options *******
    *****************************************
/*


/*
    Use the additionalContactFilters parameter to specify additional filter criteria on the contact object.
*/
List<pse.ResourceSearchService.ResourceSearchFilterField> additionalContactFilters = new List<pse.ResourceSearchService.ResourceSearchFilterField>();
pse.ResourceSearchService.ResourceSearchFilterField rsff = new pse.ResourceSearchService.ResourceSearchFilterField();

rsff.field    = Contact.pse__Resource_Role__c;
rsff.values   = new Set<Object>{'Architect', 'Senior Developer'};
rsff.operator = 'IN'; //NOTE: When using "values" IN is the only valid operator, and is automatically elected.
additionalContactFilters.add(rsff);         

rsff = new ResourceSearchService.ResourceSearchFilterField();
rsff.field    = Contact.pse__Is_Resource__c;
rsff.value    = true;
rsff.operator = '=';
additionalContactFilters.add(rsff);         

rsff = new ResourceSearchService.ResourceSearchFilterField();
rsff.field    = Contact.pse__Is_Resource_Active__c;
rsff.value    = true;
rsff.operator = '=';
additionalContactFilters.add(rsff);         

rsff = new ResourceSearchService.ResourceSearchFilterField();
rsff.field    = Contact.pse__Start_Date__c;
rsff.value    = Date.NewInstance(2015,1,1);
rsff.operator = '<';
additionalContactFilters.add(rsff);         

rsff = new ResourceSearchService.ResourceSearchFilterField();
rsff.field    = Contact.pse__Default_Cost_Rate__c;
rsff.value    = 125.00;
rsff.operator = '>=';
additionalContactFilters.add(rsff);         

rsf.additionalContactFilters = additionalContactFilters;



/*
   Use the skillSets parameter to find resources with specific skills at specified ratings.
   SkillSets is a list of a list of SkillRating.  
   Each member of the inner list are joined with an "or", and each member of the outer list are joined with an "and".

   For our example, find resources with:
      HTML4(>=Level4) OR HTML5(>=Level3) OR CSS(>=Level2)
   AND
      Java(=Level3)
   AND
         English Speaking(=Passing) OR English Writing (=Passing)
   
   Note: For our example the English skills use a custom alternative rating field.

*/

//Obtain the needed skills by some method.
pse__Skill__c skillHTML4 = [SELECT ID FROM pse__Skill__c WHERE Name = 'HTML4'];
pse__Skill__c skillHTML5 = [SELECT ID FROM pse__Skill__c WHERE Name = 'HTML5'];
pse__Skill__c skillCSS   = [SELECT ID FROM pse__Skill__c WHERE Name = 'CSS'];
pse__Skill__c skillJAVA  = [SELECT ID FROM pse__Skill__c WHERE Name = 'Java'];
pse__Skill__c skillEngS  = [SELECT ID FROM pse__Skill__c WHERE Name = 'English Speaking'];
pse__Skill__c skillEngW  = [SELECT ID FROM pse__Skill__c WHERE Name = 'English Writing'];


pse.ResourceSearchService.SkillRating rssSR;
list<pse.ResourceSearchService.SkillRating> rssSkillSet;
list<list<pse.ResourceSearchService.SkillRating>> rssSkillSets = new list<list<pse.ResourceSearchService.SkillRating>>();


//HTML4 or HTML5 or CSS
rssSkillSet = new list<pse.ResourceSearchService.SkillRating>();

rssSR = new pse.ResourceSearchService.SkillRating();
rssSR.skillID = skillHTML4.Id;
rssSR.rating  = 'Level4';
rssSR.matchGreaterThanRatings = true;
rssSkillSet.add(rssSR);

rssSR = new pse.ResourceSearchService.SkillRating();
rssSR.skillID = skillHTML5.Id;
rssSR.rating  = 'Level3';
rssSR.matchGreaterThanRatings = true;
rssSkillSet.add(rssSR);

rssSR = new pse.ResourceSearchService.SkillRating();
rssSR.skillID = skillCSS.Id;
rssSR.rating  = 'Level2';
rssSR.matchGreaterThanRatings = true;
rssSkillSet.add(rssSR);

rssSkillSets.add(rssSkillSet);


//Java
rssSkillSet = new list<pse.ResourceSearchService.SkillRating>();

rssSR = new pse.ResourceSearchService.SkillRating();
rssSR.skillID = skillJAVA.Id;
rssSR.rating  = 'Level3';
rssSR.operator = '='; //Only Level3 Java Programmers, not more advanced, not less advanced
rssSkillSet.add(rssSR);

rssSkillSets.add(rssSkillSet);


//English Speaking OR English Writing
rssSkillSet = new list<pse.ResourceSearchService.SkillRating>();

rssSR = new pse.ResourceSearchService.SkillRating();
rssSR.skillID = skillEngS.Id;
rssSR.rating  = 'Passing';
rssSR.alternativeRatingField = pse__Skill_Rating__c.Picklist_Pass_Fail__c;
rssSR.operator = '=';
rssSkillSet.add(rssSR);

rssSR = new pse.ResourceSearchService.SkillRating();
rssSR.skillID = skillEngW.Id;
rssSR.rating  = 'Passing';
rssSR.alternativeRatingField = pse__Skill_Rating__c.Picklist_Pass_Fail__c;
rssSR.operator = '=';
rssSkillSet.add(rssSR);

rssSkillSets.add(rssSkillSet);


//Set the parameter
rsf.skillSets  = rssSkillSets;





/*
    Limit to Regions/Practices/Groups
    NOTE: you can use regionFilter, practiceFilter, groupFilter for a single ID, or use the plural versions for filtering to a set of IDs.
*/

List<pse__Region__c> regions = [SELECT ID FROM pse__Region__c WHERE name IN ('California','Oregon','Washington')];
Set<Id> regionIds = new Set<Id>();
for( pse__Region__c r : regions ) regionIds.add( r.Id );
rsf.regionsFilter  = regionIds;
rsf.IncludeSubregions = true; //Include resources in sub-regions such as Norther California and Souther California and Bay Area

pse__Practice__c practice = [SELECT ID FROM pse__Practice__c WHERE name = 'Web Development'];
rsf.practiceFilter  = practice.Id;
rsf.IncludeSubpractices = true; //Include resources in sub-practices such as IIS or Apache/Tomcat or IBM Websphere

List<pse__Grp__c> groups = [SELECT ID FROM pse__Grp__c WHERE name IN ('Waterfall','Agile')];
Set<Id> groupIds = new Set<Id>();
for( pse__Grp__c g : groups ) groupIds.add( g.Id );
rsf.groupsFilter = groupIds;
rsf.IncludeSubgroups = false; //Not interested in sub groups of Waterfall or Agile
        



/*

   Utilization Options.
   The set of utilization filtering options allow searching for resources with specific availability over a specified time range.
    
   The utilizationStartDate and utilizationEndDate parameters define the range of dates over which to calculate the resource availability. 
   
   
   The following parameters control which types of assignments and resource requests are considered in the tabulation of utilization/availability:
       utilizationIncludeBillableAssignments
       utilizationIncludeCreditedAssignments
       utilizationIncludeExcludedAssignments
       utilizationIncludeNonBillableAssignments
       utilizationIncludeHeldResourceRequests
    Note: The work calendar hours are always considered in the calculation.   


    These parameters control the criteria applied to the availability calculation for filtering the results:
        utilizationMinimumHoursAvailable
        utilizationMinimumAvailability
        utilizationAppliedConjunctionAnd
        utilizationNoMinimumAvailabilityRequirements

*/


/*
  In this example, we need someone for the months of June and July of 2017.
*/
rsf.utilizationStartDate = Date.newInstance(2017,6,1);
rsf.utilizationEndDate   = Date.newInstance(2017,7,31);

/*
  Only consider billable assignments and held resource requests. 
  This is a high priority project and thus credited/excluded/nonbillable assignments will be rescheduled to accommodate it.
*/
rsf.utilizationIncludeBillableAssignments    = true;
rsf.utilizationIncludeCreditedAssignments    = false;
rsf.utilizationIncludeExcludedAssignments    = false;
rsf.utilizationIncludeNonBillableAssignments = false;
rsf.utilizationIncludeHeldResourceRequests   = true;


/*
 Find me resources with 160 available hours (or more) AND who are 50% or more available
 Search by either Hours or Percent Availability or by both and indicate if "AND" or "OR" should be applied when using both conditions.
*/
rsf.utilizationMinimumHoursAvailable = 160;
rsf.utilizationMinimumAvailability   = 0.50;
rsf.utilizationAppliedConjunctionAnd = true; //Set this to false to find resource that are either (OR) condition.


/*
 Set this option to true when you want to have the API calculate availability information for the time range, but not enforce any filtering.
 The availability information is returned in the results.
*/
rsf.utilizationNoMinimumAvailabilityRequirements = false;



/*
  Use the additionalSemiJoinFilters to filter to resources who are members of specific sets. 
  Sets are defined via sObjects that have a relationship field to contact.

  For example:
  Assume we have a sObject called "Cool_Place__c" which is a list of exciting places where projects take place. (It has the standard Fields ID and Name). 
  We also have an sObject called "My_Wishlist__c" that allows resources to indicate the cool places they want to work at.  
  It has these fields: ID, Name, Resource__c (lookup to Contact), Place_I_Want_To_See__c (lookup to Cool_Place__c)

  Our Project needs people in AUS or NZ, AND needs people in Spain.  We will search for resources that want to work in (AUS OR NZ) AND (Spain).   

*/

list<pse.ResourceSearchService.SemiJoinFilter> rssSemiJoinFilters = new list<pse.ResourceSearchService.SemiJoinFilter>();
pse.ResourceSearchService.SemiJoinFilter sjf;

//Add "AND" (AUS or NZ)
List<Cool_Place__c> places1 = [SELECT ID FROM Cool_Place__c WHERE Name IN ('AUS','NZ')];
set<ID> placeIds1 = new Set<ID>();
for (Cool_Place__c cp : places1) placeIds1.add(cp.Id);
sjf = new pse.ResourceSearchService.SemiJoinFilter();
sjf.relatedObject = My_Wishlist__c.getSObjectType();
sjf.relationshipField = My_Wishlist__c.Resource__c;
sjf.searchField = My_Wishlist__c.Place_I_Want_To_See__c;
sjf.values = placeIds1;
rssSemiJoinFilters.add(sjf);

//Add "AND" Spain
List<Cool_Place__c> places2 = [SELECT ID FROM Cool_Place__c WHERE Name IN ('Spain')];
set<ID> placeIds2 = new Set<ID>();
for (Cool_Place__c cp : places2) placeIds2.add(cp.Id);
sjf = new pse.ResourceSearchService.SemiJoinFilter();
sjf.relatedObject = My_Wishlist__c.getSObjectType();
sjf.relationshipField = My_Wishlist__c.Resource__c;
sjf.searchField = My_Wishlist__c.Place_I_Want_To_See__c;
sjf.values = placeIds2;
rssSemiJoinFilters.add(sjf);

//Set the filter parameter
rsf.additionalSemiJoinFilters = rssSemiJoinFilters;




// *************************
// ********CALL API*********
// *************************
list<Contact> resources = ResourceSearchService.execute(rsf);


// *************************
// *****Get Debug Info******
// *************************
debug = ResourceSearchService.debug();





debug

global static String debug()

The debug method provides diagnostic information about the status of the generated query.

Return Value

Returns a string containing the generated queries and any error messages

ResourceSearchService

global ResourceSearchService()

Comparison used by availability filters

pse.ResourceSearchService.ResourceSearchFilter

global class ResourceSearchFilter

Used to define the criteria to be used by the resource search API execute method.

Properties

Name Type Description
maxReturnedResults Integer Defines the maximum number of results to return.
fieldsToSelect Set<String> Specifies the Contact object fields to retrieve.
skillsToSelect Set<ID> Specifies the Skill records associated with the Contact to retrieve.
orderByFields List<String> Specifies the Contact object fields by which to sort the results.
additionalContactFilters List<pse.ResourceSearchService.ResourceSearchFilterField> Refines search results using filters defined in ResourceSearchFilterField. Filter values are <field><operator><value> with SOQL operators valid for the field type and an appropriate value for the field type.
additionalSemiJoinFilters List<pse.ResourceSearchService.SemiJoinFilter> Refines search results using related lists consisting of the related object, relationship field (the Resource (Contact) object), the field to search containing the relevant ID, and the ID.
skillSets List<list<pse.ResourceSearchService.SkillRating>> A list of lists containing sets of skills. Each "skill set" (inner list) is an AND operation, while each member of the "skill set" (inner list) are "OR" operations.
applyStaffingPermissionControls Boolean If set to true, then Staffing permission controls are factored into the results and returns only resources the user has staffing permissions for.
resourceIds Set<Id> A set of resource Ids by which the search should be limited.
disableSharingModel Boolean If set to true, the API will bypass the Sharing Model.
disableSecurityOnReturnedData Boolean If set to true, then CRUD and field-level security (FLS) are applied to returned data fields. If set to false (default) an error is thrown if the user does not have the required permissions.
disableSecurityOnSearchCriteria Boolean If set to true, then CRUD and field-level security (FLS) are disabled for data fields used to filter results. If set to false (default) an error is thrown if the user does not have the required permissions.
regionFilter ID Searches for Resource records in a Region. Note that you cannot use this property in conjunction with regionsFilter.
regionsFilter Set<ID> Searches for Resource records in a set of Regions. Note that you cannot use this property in conjunction with regionFilter.
includeSubregions Boolean Includes sub-regions included under the Region(s) searched.
practiceFilter ID Searches for Resource records in a Practice. Note that you cannot use this property in conjunction with practicesFilter.
practicesFilter Set<ID> Searches for Resource records in a set of Practices. Note that you cannot use this property in conjunction with practiceFilter.
includeSubpractices Boolean Includes sub-practices included under the Practice searched.
groupFilter ID Searches for Resource records in a Group. Note that you cannot use this property in conjunction with groupsFilter.
groupsFilter Set<ID> Searches for Resource records in a set of Groups. Note that you cannot use this property in conjunction with groupFilter.
includeSubgroups Boolean Includes sub-groups included under the Group searched.
utilizationStartDate Date Specifies the start date for when you need the Resource.
utilizationEndDate Date Specifies the end date for when you need the Resource.
utilizationIncludeBillableAssignments Boolean Set to false to exclude billable assignments from the Resource search. By default, this value is true.
utilizationIncludeCreditedAssignments Boolean Set to false to exclude credited assignments from the Resource search. By default, this value is true.
utilizationIncludeExcludedAssignments Boolean Set to false to exclude excluded assignments from the Resource search. By default, this value is true.
utilizationIncludeNonBillableAssignments Boolean Set to false to exclude non-billable assignments from the Resource search. By default, this value is true.
utilizationIncludeHeldResourceRequests Boolean Set to false to exclude held resource requests from the Resource search. By default, this value is true.
utilizationMinimumHoursAvailable Decimal Specifies a numeric value specifying the minimum number hours. Note that you cannot use this property in conjunction with the utilizationNoMinimumAvailabilityRequirements global variable.
utilizationMinimumAvailability Decimal Specifies percentage of minimum availability. Note that you cannot use this property in conjunction with the utilizationNoMinimumAvailabilityRequirements global variable.
utilizationAppliedConjunctionAnd Boolean By default, if both utilizationMinimumHoursAvailable and utilizationMinimumAvailability are supplied then both conditions must be met. Set this value to false to retrieve resources that meet either condition. Note that you cannot use this property in conjunction with the utilizationNoMinimumAvailabilityRequirements global variable.
utilizationNoMinimumAvailabilityRequirements Boolean By default, you must supply either the utilizationMinimumHoursAvailable or the utilizationMinimumAvailability global variable to generate utilization data. Set this value to true to generate utilization data for all matching resources. Note that you cannot use this property in conjunction with the utilizationMinimumAvailability, utilizationMinimumAvailability, or utilizationAppliedConjunctionAnd global variables.
assignments pse.ResourceSearchService.Assignments Retrieve assignments that are assigned to the Resource.
isAssigned Boolean When this variable is set to true, the API uses (data_assigned__c fields = true) to query the Utilization_Engine_TOD__c and returns the resources with assignments in the requested time frame global variable.
isCalendared Boolean When this variable is set to true, the API uses (data_calendar__c fields = true) to query the Utilization_Engine_TOD__c and returns the calendared resources who have working hours in the requested time frame global variable.
isHeld Boolean When this variable is set to true, the API uses (data_held__c fields = true) to query the Utilization_Engine_TOD__c and returns resources that have held resource request in the requested time frame global variable.
startTimeOfDay DateTime Specifies the start time of the day when you need the resource
endTimeOfDay DateTime Specifies the end time of the day when you need the resource
requests pse.ResourceSearchService.ResourceRequests Retrieve held resource requests that are assigned to the Resource.
elevateToWithoutSharing Boolean Deprecated: see disableSharingModel
applySecurityToReturnedData Boolean Deprecated: see disableSecurityOnReturnedData
applySecurityToSearchCriteria Boolean Deprecated: see disableSecurityOnSearchCriteria

Methods

ResourceSearchFilter

global ResourceSearchFilter()

A default no args constructor

pse.ResourceSearchService.ResourceSearchFilterField

global class ResourceSearchFilterField

Defines the Resource fields to use as filters for the search.

Properties

Name Type Description
field sObjectField Defines the field to search.
operator String Defines the operator. Must be appropriate for the field (See the Salesforce SOQL Documentation for more about soql comparison operators ).
value Object Defines the value to search for. Must be appropriate for the field. Note that this property should not be used with the values property.
values Set<Object> Defines values to search for. Must be appropriate for the field. Note that this property cannot be used with the value property.

Methods

ResourceSearchFilterField

global ResourceSearchFilterField()

A default no args constructor

ResourceSearchFilterField

global ResourceSearchFilterField(sObjectField field, String operator, Object value)

A general constructor that takes the default fields

Input Parameters

Name Type Description
field sObjectField - and sObjectField found on the contact SObject to search against
operator String - any valid SOQL comparison operator for this field type
value Object - any object specifying the value qualifying as a match (must match data type of field)

ResourceSearchFilterField

global ResourceSearchFilterField(sObjectField field, Set<Object> values)

A constructor that takes a field and a set of values to which that field must belong

Input Parameters

Name Type Description
field sObjectField - and sObjectField found on the contact SObject to search against
values Set<Object> - set of objects specifying the values that qualify as a match (must match data type of field)

pse.ResourceSearchService.SemiJoinFilter

global class SemiJoinFilter

Defines a related list to be used as a filter in the search.

Properties

Name Type Description
relatedObject sObjectType Defines the related Object.
relationshipField sObjectField Defines the relationship field. Normally Resource__c or Contact__c. This is the field that looks up the Contact object
searchField sObjectField Defines the field in which to search for the given values.
values Set<Id> Defines the values for which to search.

Methods

SemiJoinFilter

global SemiJoinFilter()

A default no args constructor

SemiJoinFilter

global SemiJoinFilter(sObjectType relatedObject, sObjectField relationshipField, sObjectField searchField, Set<Id> values)

A general constructor taking all parameters

Input Parameters

Name Type Description
relatedObject sObjectType - The related object to search against
relationshipField sObjectField - The lookup field on the relatedObject that references the contact object
searchField sObjectField -- A lookup field on the relatedObject that will be searched against
values Set<Id> - The id values that qualify as a match

pse.ResourceSearchService.SkillRating

global class SkillRating

Defines a skill rating to be used in conjunction with skills filters.

Properties

Name Type Description
skillID ID The ID of the Skill for which to search
rating String The minimum skill rating required to qualify as a match. If null, matches are based on skill without evaluating specific ratings.
alternativeRatingField sObjectField The field from the Skill_Certification_Rating__c on which to search ratings. If null, the Rating__c field is used.
matchGreaterThanRatings Boolean Includes skill ratings greater than the specified rating. When false, searches for specified ratings must match the exact rating. Note that you cannot use this property in conjunction with operator or a null rating.
operator String Defines the operator. Must contain an appropriate value for the field (see the Salesforce SOQL Documentation for more about soql comparison operators). Note that you cannot use this property in conjunction with matchGreaterThanRatings or a null rating. If the rating is 'None', then the only valid operators are '=' (equal) or '!=' (not equal).

Methods

SkillRating

global SkillRating()

A default no args constructor.

SkillRating

global SkillRating(ID skillID, String rating)

A constructor taking the Skill ID and Skill Rating values.

Input Parameters

Name Type Description
skillID ID - The ID of the Skill for which to search
rating String - The minimum skill rating required to qualify as a match (use null to match all ratings)

SkillRating

global SkillRating(ID skillID, String rating, sObjectField alternativeRatingField, Boolean matchGreaterThanRatings)

A constructor using the Skill ID, Skill Rating, Alternative Rating Field, and Match Greater Than Rating values.

Input Parameters

Name Type Description
skillID ID - The ID of the Skill for which to search
rating String - The minimum skill rating required to qualify as a match (use null to match all ratings)
alternativeRatingField sObjectField - The Skill_Certification_Rating__c field on which to search ratings.
matchGreaterThanRatings Boolean - Includes skill ratings greater than the specified rating.

SkillRating

global SkillRating(ID skillID, String rating, sObjectField alternativeRatingField, Boolean matchGreaterThanRatings, String operator)

A constructor using the Skill ID, Skill Rating, Alternative Rating Field, Match Greater Than Rating, and Operator values.

Input Parameters

Name Type Description
skillID ID - The ID of the Skill for which to search
rating String - The minimum skill rating required to qualify as a match (use null to match all ratings)
alternativeRatingField sObjectField - The Skill_Certification_Rating__c field on which to search ratings.
matchGreaterThanRatings Boolean - Includes skill ratings greater than the specified rating.
operator String - any valid SOQL comparison operator

pse.ResourceSearchService.Assignments

global class Assignments

Retrieve assignments that are assigned to the Resource.

Properties

Name Type Description
startDate Date The start date for assignments.
endDate Date The end date for assignments.
maxReturned Integer Maximum number of assignments to return for a resource.
includeBillable Boolean If enabled, include billable assignments.
includeNonbillable Boolean If enabled, include non-billable assignments.
includeCredited Boolean If enabled, include credited assignments.
includeExcluded Boolean If enabled, include excluded assignments.
includeExcludedFromPlanners Boolean If enabled, include assignments that are excluded from planners.
includeTeamAssignments Boolean If enabled, include team assignments from Shift Management.
fields Set<String> Fields to retrieve from matching assignments.

Methods

Assignments

global Assignments()

A default no args constructor.

Assignments

global Assignments(Date startDate, Date endDate, Integer maxReturned)

A constructor taking the startDate, endDate, and maxReturned values.

Input Parameters

Name Type Description
startDate Date - Start date for assignments
endDate Date - End date for assignments
maxReturned Integer - Maximum number of assignments to return

Assignments

global Assignments(Date startDate, Date endDate, Integer maxReturned, Set<String> fields)

A constructor taking the startDate, endDate, maxReturned, and fields values.

Input Parameters

Name Type Description
startDate Date - Start date for assignments
endDate Date - End date for assignments
maxReturned Integer - Maximum number of assignments to return
fields Set<String> - Fields to retrieve from matching assignments

Assignments

global Assignments(Date startDate, Date endDate, Integer maxReturned, Boolean includeBillable, Boolean includeNonbillable, Boolean includeCredited, Boolean includeExcluded, Set<String> fields)

A constructor taking the startDate, endDate, maxReturned, includeBillable, includeCredited, includeExcluded, and fields values.

Input Parameters

Name Type Description
startDate Date - Start date for assignments
endDate Date - End date for assignments
maxReturned Integer - Maximum number of assignments to return
includeBillable Boolean - If enabled, include billable assignments
includeNonbillable Boolean - If enabled, include non-billable assignments
includeCredited Boolean - If enabled, include credited assignments
includeExcluded Boolean - If enabled, include excluded assignments
fields Set<String> - Fields to retrieve from matching assignments

pse.ResourceSearchService.ResourceRequests

global class ResourceRequests

Retrieve held resource requests that are assigned to the Resource.

Properties

Name Type Description
startDate Date The start date for resource requests.
endDate Date The end date for resource requests.
useScheduleDates Boolean Apply date range parameters to schedule dates.
maxReturned Integer Maximum number of resource requests to return for a resource.
includeRequestsWithoutSchedules Boolean If enabled, include resource requests that lack schedules.
includeRequestsThatBecameAssignments Boolean If enabled, include resource requests that become assignments.
includeExludedFromPlanners Boolean If enabled, include resource requests that are excluded from planners.
fields Set<String> Fields to retrieve from matching resource requests.

Methods

ResourceRequests

global ResourceRequests()

A default no args constructor.

ResourceRequests

global ResourceRequests(Date startDate, Date endDate, Integer maxReturned)

A constructor taking the startDate, endDate, and maxReturned values.

Input Parameters

Name Type Description
startDate Date - Start date for resource requests
endDate Date - End date for resource requests
maxReturned Integer - Maximum number of resource requests to return

ResourceRequests

global ResourceRequests(Date startDate, Date endDate, Integer maxReturned, Set<String> fields)

A constructor taking the startDate, endDate, maxReturned, and fields values.

Input Parameters

Name Type Description
startDate Date - Start date for resource requests
endDate Date - End date for resource requests
maxReturned Integer - Maximum number of resource requests to return
fields Set<String> - Fields to retrieve from matching resource requests

ResourceRequests

global ResourceRequests(Date startDate, Date endDate, Integer maxReturned, Boolean includeRequestsWithoutSchedules, Boolean includeRequestsThatBecameAssignments, Set<String> fields)

A constructor taking the startDate, endDate, maxReturned, includeRequestsWithoutSchedules, includeRequestsThatBecameAssignments and fields values.

Input Parameters

Name Type Description
startDate Date - Start date for resource requests
endDate Date - End date for resource requests
maxReturned Integer - Maximum number of resource requests to return
includeRequestsWithoutSchedules Boolean - If enabled, include resource requests that lack schedules
includeRequestsThatBecameAssignments Boolean - If enabled, include resource requests that become assignments
fields Set<String> - Fields to retrieve from matching resource requests
© Copyright 2009–2018 FinancialForce.com, inc. All rights reserved. Various trademarks held by their respective owners.