| Qore SalesforceRestDataProvider Module Reference 2.0

Loading...
Searching...
No Matches
Functions
SOQL Column Operator Functions

## Functions
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_avg (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"avg"` operator; returns average column values
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_calendar_month (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"calendar_month"` function; returns the calendar month for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_calendar_quarter (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"calendar_quarter"` function; returns the calendar quarter for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_calendar_year (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"calendar_year"` function; returns the calendar year for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_convert_currency (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"convertCurrency"` operator; returns the given column value in the default currency for the current user
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_count (auto column='')
| returns a SoqlColumnOperatorInfo hash for the `"count"` aggregate function; returns row counts
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_count_distinct (auto column='')
| returns a SoqlColumnOperatorInfo hash for the `"count_distinct"` aggregate function; returns row counts
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_day_in_month (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"day_in_month"` function; returns the day in the month for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_day_in_week (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"day_in_week"` function; returns the day in the week for a date or date/time value (1 = Sunday, 7 = Saturday)
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_day_in_year (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"day_in_year"` function; returns the day in the year for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_day_only (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"day_only"` function; returns the date from a date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_fiscal_month (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"fiscal_month"` function; returns the fiscal month for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_fiscal_quarter (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"fiscal_quarter"` function; returns the fiscal quarter for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_fiscal_year (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"fiscal_year"` function; returns the fiscal year for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_format (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"format"` operator; returns the given column value in the default locale for number, date, time, and currency fields
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_hour_in_day (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"hour_in_day"` function; returns the hextern in the day for a date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_max (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"max"` operator; returns maximum column values
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_min (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"min"` operator; returns minimum column values
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_sum (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"sum"` operator; returns the total sum of a numeric column.
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_week_in_month (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"week_in_month"` function; returns the week in the month for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_cop_week_in_year (auto column)
| returns a SoqlColumnOperatorInfo hash for the `"week_in_m=year"` function; returns the week in the year for a date or date/time value
hash< SoqlColumnOperatorInfo > | SalesforceRestDataProvider::soql_make_cop (string cop, auto column, auto arg)

## Detailed Description

These are functions that can be used in the `"columns"` argument for select statements:

- soql_cop_avg(): return the averge value for the given column when grouping
- soql_cop_max(): return the maximum value for the given column when grouping
- soql_cop_min(): return the minimum value for the given column when grouping
- soql_cop_sum(): return the sum of all values for the given column when grouping
- soql_cop_count(): use the `COUNT()` function in the query
- soql_cop_count_distinct(): use the `COUNT_DISTINCT()` function in the query
- soql_cop_format(): use the FORMAT() on the given column
- soql_cop_convert_currency(): return the given column value in the default currency for the calling user
- soql_cop_calendar_month(): return the calendar month of a date or date/time value
- soql_cop_calendar_quarter(): return the calendar quarter of a date or date/time value
- soql_cop_calendar_year(): return the calendar year of a date or date/time value
- soql_cop_day_in_month(): return the day in a month of a date or date/time value
- soql_cop_day_in_week(): return the day in the week of a date or date/time value (1 = Sunday, 7 = Saturday)
- soql_cop_day_in_year(): return the day in the year of a date or date/time value
- soql_cop_day_only(): return the date from a date/time value
- soql_cop_fiscal_month(): return the fiscal month of a date or date/time value
- soql_cop_fiscal_quarter(): return the fiscal quarter of a date or date/time value
- soql_cop_fiscal_year(): return the fiscal year of a date or date/time value
- soql_cop_hour_in_day(): return the hour in the day of a date/time value
- soql_cop_week_in_month(): return the week in the month of a date or date/time value
- soql_cop_week_in_year(): return the week in the year of a date or date/time value

## Function Documentation

## ◆ soql_cop_avg()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_avg | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"avg"` operator; returns average column values

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": (soql_cop_avg("quantity")), "where": {"OrderType": "wholesale"}});

Parameters

  column | the column specification for the column

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_calendar_month()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_calendar_month | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"calendar_month"` function; returns the calendar month for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_calendar_month("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_calendar_quarter()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_calendar_quarter | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"calendar_quarter"` function; returns the calendar quarter for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_calendar_quarter("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_calendar_year()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_calendar_year | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"calendar_year"` function; returns the calendar year for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_calendar_year("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_convert_currency()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_convert_currency | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"convertCurrency"` operator; returns the given column value in the default currency for the current user

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {soql_cop_convert_currency("AnnualRevenue")}, "where": {"OrderType": "wholesale"}});

Parameters

  column | the column specification for the column

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_count()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_count | ( | auto | column = '' | ) |

returns a SoqlColumnOperatorInfo hash for the `"count"` aggregate function; returns row counts

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_count()}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_count_distinct()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_count_distinct | ( | auto | column = '' | ) |

returns a SoqlColumnOperatorInfo hash for the `"count_distinct"` aggregate function; returns row counts

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_count_distinct()}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_day_in_month()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_day_in_month | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"day_in_month"` function; returns the day in the month for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_day_in_month("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_day_in_week()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_day_in_week | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"day_in_week"` function; returns the day in the week for a date or date/time value (1 = Sunday, 7 = Saturday)

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_day_in_week("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_day_in_year()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_day_in_year | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"day_in_year"` function; returns the day in the year for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_day_in_year("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_day_only()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_day_only | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"day_only"` function; returns the date from a date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_day_only("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_fiscal_month()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_fiscal_month | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"fiscal_month"` function; returns the fiscal month for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_fiscal_month("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_fiscal_quarter()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_fiscal_quarter | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"fiscal_quarter"` function; returns the fiscal quarter for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_fiscal_quarter("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_fiscal_year()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_fiscal_year | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"fiscal_year"` function; returns the fiscal year for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_fiscal_year("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_format()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_format | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"format"` operator; returns the given column value in the default locale for number, date, time, and currency fields

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {soql_cop_format("Quantity")}, "where": {"OrderType": "wholesale"}});

Parameters

  column | the column specification for the column

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

Note
  using this function on a date or date/time field will cause it to be returned as a string instead of a date/time value

## ◆ soql_cop_hour_in_day()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_hour_in_day | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"hour_in_day"` function; returns the hextern in the day for a date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_hour_in_day("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_max()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_max | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"max"` operator; returns maximum column values

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": (soql_cop_max("id")), "where": {"Type": "user"}});

Parameters

  column | the column specification for the column

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_min()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_min | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"min"` operator; returns minimum column values

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": (soql_cop_min("Id")), "where": {"Type": "user"}});

Parameters

  column | the column specification for the column

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_sum()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_sum | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"sum"` operator; returns the total sum of a numeric column.

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": (soql_cop_sum("quantity")), "where": {"OrderType": "wholesale"}});

Parameters

  column | the column specification for the column

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_week_in_month()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_week_in_month | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"week_in_month"` function; returns the week in the month for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_week_in_month("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_cop_week_in_year()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_cop_week_in_year | ( | auto | column | ) |

returns a SoqlColumnOperatorInfo hash for the `"week_in_m=year"` function; returns the week in the year for a date or date/time value

Example:
  AbstractDataProviderRecordIterator i = provider.searchRecords({"columns": {"AccountType", soql_cop_week_in_year("OrderDate")}, "where": {"Type": "user"}, "groupby": "AccountType"});

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the `"columns"` argument of a search option hash

## ◆ soql_make_cop()

hash< SoqlColumnOperatorInfo > SalesforceRestDataProvider::soql_make_cop | ( | string | cop,
|  | auto | column,
|  | auto | arg )

returns a SoqlColumnOperatorInfo hash

Parameters

  cop | the column operator (one of SOQL Column Operators)
  column | the column name
  arg | the argument to the operator

Returns
  a SoqlColumnOperatorInfo hash corresponding to the arguments for use in the columns argument of a search option hash

Note
  Normally this function is not called directly, but rather by the other column operator functions