Share this page

# searchCostRules

## Purpose

Searches all the existing cost rules in the system that satisfy the search criteria provided.

## Function

For a given search criteria, this operation gets all the cost rules satisfying the criteria. The criteria include the effective dates and the cost rate for the cost rules.

## Limitations

The maximum number of results cannot exceed 1,000.

## Related Information

getCostRules gets all the cost rules for a given set of IDs.

## Input

CostRuleSearchFilter

## Return

An object with an array of WSCostRuleBean corresponding to the given search filter.

## Java Interface

`SearchCostRulesResponseDocument searchCostRules (SearchCostRulesDocument in)`

Parameters | Description
--- | ---
SearchCostRulesDocument | Wrapper for cost rule search filter (CostRuleSearchFilter).
SearchCostRulesResponseDocument | Wrapper for the array of cost rule beans (WSCostRuleBean) that the caller obtains by performing the search operation.

## Java Examples

Example: Search cost rules for a given set of IDs.

    CostRule[] searchAllCostRules() throws Exception {
        FinanceServiceStub FM = new FinanceServiceStub(ctx, WSURL);
        SearchCostRulesDocument searchCostRulesDoc =
    SearchCostRulesDocument.Factory.newInstance();
        searchCostRulesDoc.addNewSearchCostRules().addNewFilter();
    // empty filter finds ALL rules
        SearchCostRulesResponse searchResponse =
    FM.searchCostRules(searchCostRulesDoc).getSearchCostRulesRespon
    se();
        return searchResponse.getCostRuleArray();
        }

## Errors and Exceptions

When an error occurs on this operation, you will see a description of the root cause in the log or in the response message.

The server log file content is similar to the following:

    Exception in thread "main" org.apache.axis2.AxisFault:
    <exception:exceptionDetails xmlns:exception="http://
    www.mercury.com/ppm/ws/exception">
    <exception:detail>[root cause description] </exception:detail>

    </exception:exceptionDetails>

## Root Cause Descriptions

Possible root cause descriptions:

Message Code | Message | Cause(s) | Possible Corrective Action
--- | --- | --- | ---
exception.authorization | You do not have the privilege to take this action. Consult your PPM Administrator. | User is not authorized to search cost rules. | Check the user licenses and privileges (access grants).

https://admhelp.microfocus.com PPM 8942
Tips to improve your search results... OpenText™ Project and Portfolio Management Help Center PPM Help 26.2-26.3 All View Local Help Center View Online Help Center Version: