Object Function Returning Un-Filtered GetEstimatedRecordCount

(Doc ID 2032342.1)

Last updated on JULY 21, 2015

Applies to:

Oracle Fusion Sales Cloud Service - Version and later
Information in this document applies to any platform.


The code below is showing all results when the customer would expect it to return a 0, but it consistently returns the number of all opportunities.
The code is for a Formula Field in a Custom Object in the Common Application.


def thisId = nvl(Contact_Id_c, null) // The PartyId for the associated contact - proven working
def total = 0

if (thisId != null)

  def allTrainings = newView('OpportunityVO')
  def criteria = newViewCriteria(allTrainings)
  def critRow = criteria.createRow()

  def thisInstructor = critRow.ensureCriteriaItem('TeamMembers_c') // this field contains all team member PartyIds and their Role_c separated by a space and delimited y semicolons

  if (role == 'All') // Role is passed via parameter
  thisInstructor.setValue('%' + thisId.toString() + '%')
  } else {
  thisInstructor.setValue('%' + thisId.toString() + ' ' + role + ';%')

  total = allTrainings.getEstimatedRowCount()

return total


Sign In with your My Oracle Support account

Don't have a My Oracle Support account? Click to get started

My Oracle Support provides customers with access to over a
Million Knowledge Articles and hundreds of Community platforms