0

I'm trying to find the metadata for the matching filter for any sObject in my case its 'Opportunity' is that possible to find out the what the filter matching creatria is? using REST API

I have played with workbench using the REST explorer:

/services/data/v39.0/sobjects/opportunity/describe

but I did not get information which I'm looking for.

Shown below in the screen shot, I'm trying to find matching filter criteria is:

enter image description here

  • 1
    have you looked into the listview describe call? – Ratan Paul Sep 28 '17 at 18:39
0

Using SOQL I don't think this is possible but using listview describe you will get the all details check this out

List View Describe Returns detailed information about a list view, including the ID, the columns, and the SOQL query. This resource is available in REST API version 32.0 and later.

URI /vXX.X/sobjects/{sobjectType}/listviews/{queryLocator}/describe

{
  "columns" : [ {
    "ascendingLabel" : "Z-A",
    "descendingLabel" : "A-Z",
    "fieldNameOrPath" : "Name",
    "hidden" : false,
    "label" : "Account Name",
    "selectListItem" : "Name",
    "sortDirection" : "ascending",
    "sortIndex" : 0,
    "sortable" : true,
    "type" : "string"
  }, {
    "ascendingLabel" : "Z-A",
    "descendingLabel" : "A-Z",
    "fieldNameOrPath" : "Site",
    "hidden" : false,
    "label" : "Account Site",
    "selectListItem" : "Site",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : true,
    "type" : "string"
  }, {
    "ascendingLabel" : "Z-A",
    "descendingLabel" : "A-Z",
    "fieldNameOrPath" : "BillingState",
    "hidden" : false,
    "label" : "Billing State/Province",
    "selectListItem" : "BillingState",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : true,
    "type" : "string"
  }, {
    "ascendingLabel" : "9-0",
    "descendingLabel" : "0-9",
    "fieldNameOrPath" : "Phone",
    "hidden" : false,
    "label" : "Phone",
    "selectListItem" : "Phone",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : true,
    "type" : "phone"
  }, {
    "ascendingLabel" : "Low to High",
    "descendingLabel" : "High to Low",
    "fieldNameOrPath" : "Type",
    "hidden" : false,
    "label" : "Type",
    "selectListItem" : "toLabel(Type)",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : true,
    "type" : "picklist"
  }, {
    "ascendingLabel" : "Z-A",
    "descendingLabel" : "A-Z",
    "fieldNameOrPath" : "Owner.Alias",
    "hidden" : false,
    "label" : "Account Owner Alias",
    "selectListItem" : "Owner.Alias",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : true,
    "type" : "string"
  }, {
    "ascendingLabel" : null,
    "descendingLabel" : null,
    "fieldNameOrPath" : "Id",
    "hidden" : true,
    "label" : "Account ID",
    "selectListItem" : "Id",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : false,
    "type" : "id"
  }, {
    "ascendingLabel" : null,
    "descendingLabel" : null,
    "fieldNameOrPath" : "CreatedDate",
    "hidden" : true,
    "label" : "Created Date",
    "selectListItem" : "CreatedDate",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : false,
    "type" : "datetime"
  }, {
    "ascendingLabel" : null,
    "descendingLabel" : null,
    "fieldNameOrPath" : "LastModifiedDate",
    "hidden" : true,
    "label" : "Last Modified Date",
    "selectListItem" : "LastModifiedDate",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : false,
    "type" : "datetime"
  }, {
    "ascendingLabel" : null,
    "descendingLabel" : null,
    "fieldNameOrPath" : "SystemModstamp",
    "hidden" : true,
    "label" : "System Modstamp",
    "selectListItem" : "SystemModstamp",
    "sortDirection" : null,
    "sortIndex" : null,
    "sortable" : false,
    "type" : "datetime"
  } ],
  "id" : "00BD0000005WcBe",
  "orderBy" : [ {
    "fieldNameOrPath" : "Name",
    "nullsPosition" : "first",
    "sortDirection" : "ascending"
  }, {
    "fieldNameOrPath" : "Id",
    "nullsPosition" : "first",
    "sortDirection" : "ascending"
  } ],
  "query" : "SELECT name, site, billingstate, phone, tolabel(type), 
     owner.alias, id, createddate, lastmodifieddate,
   systemmodstamp FROM Account WHERE CreatedDate = THIS_WEEK ORDER BY
   Name ASC NULLS FIRST, Id ASC NULLS FIRST",
  "scope" : null,
  "sobjectType" : "Account",
  "whereCondition" : {
    "field" : "CreatedDate",
    "operator" : "equals",
    "values" : [ "THIS_WEEK" ]
  }
}

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.