{"id":2881,"date":"2020-12-11T13:05:32","date_gmt":"2020-12-11T13:05:32","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/?p=2821"},"modified":"2024-07-01T12:06:51","modified_gmt":"2024-07-01T12:06:51","slug":"query-function-for-custom-objects","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/","title":{"rendered":"Query Function for Custom Objects"},"content":{"rendered":"\n<p>With the <a rel=\"noreferrer noopener\" href=\"https:\/\/www.greytrix.com\/product\/professional-services\/sage-intacct-development-services\" target=\"_blank\">Sage Intacct<\/a> 2020 Release 4, the new Query function can now be used for querying Custom Objects as well. In our <a href=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/2020\/04\/20\/querying-data-in-sage-intacct-using-new-query-function\/\">previous blog<\/a> we saw how Query Function works on Standard Objects.<br><br>In this blog we shall see Query function examples on Custom Objects and how we can get values for fields on related Custom Object and how to use them in filters.<\/p>\n\n\n\n<p>Easy and complex queries including both the standard and custom objects by accessing the relationship can be used to seek the records from both objects. See the example below. \u201car_invoice_detail_commission\u201d is a custom object related to standard object \u201cARINVOICE\u201d with many-to-one relationship type.<\/p>\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png\" alt=\"Query Custom Object\"><\/a><\/p>\n\n\n<p>To know the fields available for querying, we can get the fields as well as relationships with the\u00a0lookup\u00a0function. The lookup function\u00a0returns a list of all the fields and relationships for standard or custom objects. Only those fields or relationships can be used to query data from that object. The relationship type must be Many-to-One to be able to retrieve the data of the related object, whether it is a standard or a custom object. <br>The below query will return all the fields and relationships for custom object ar_invoice_detail_commission.<\/p>\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/lookup-function.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/lookup-function.png\" alt=\"Lookup Function\"><\/a><\/p>\n\n\n<p>As seen in the previous blog we can add filter sets with different aggregate and summation functions, and offsets for pagination as well. Below is an example for using filters.<\/p>\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object1.png\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" class=\"size-full\" style=\"border: 1px solid #A9A9A9; padding: 2px; margin: 2px;\" src=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object1.png\" alt=\"Query Custom Object\"><\/a><\/p>\n\n\n<p>The above query will seek all the custom object records along with the records\u2019 related object field (R10374.RECORDID) for mentioned customer id (CUST-0012). <\/p>\n\n\n\n<p>The new Query function is indeed very powerful and time saving. It reduces round trips by fetching data from related objects at once.<\/p>\n\n\n","protected":false},"excerpt":{"rendered":"<p>With the Sage Intacct 2020 Release 4, the new Query function can now be used for querying Custom Objects as well. In our previous blog we saw how Query Function works on Standard Objects. In this blog we shall see Query function examples on Custom Objects and how we can get values for fields on\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[316,205,206,34,119],"class_list":["post-2881","post","type-post","status-publish","format-standard","hentry","category-sage-intacct","tag-2020-release-4","tag-query","tag-query-function","tag-sage-intacct","tag-sage-intacct-web-services"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Query Method for Personalized Items<\/title>\n<meta name=\"description\" content=\"Discover how to obtain the values for fields on related Custom Objects and apply them in filters by studying about query function examples on Custom Objects.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Query Method for Personalized Items\" \/>\n<meta property=\"og:description\" content=\"Discover how to obtain the values for fields on related Custom Objects and apply them in filters by studying about query function examples on Custom Objects.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage Intacct \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2020-12-11T13:05:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-07-01T12:06:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png\" \/>\n<meta name=\"author\" content=\"Greytrix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greytrix\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/\",\"name\":\"Query Method for Personalized Items\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png\",\"datePublished\":\"2020-12-11T13:05:32+00:00\",\"dateModified\":\"2024-07-01T12:06:51+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#\/schema\/person\/e108e7d0e2204e7a4b30748b516741c8\"},\"description\":\"Discover how to obtain the values for fields on related Custom Objects and apply them in filters by studying about query function examples on Custom Objects.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#primaryimage\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png\",\"contentUrl\":\"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Query Function for Custom Objects\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/\",\"name\":\"Sage Intacct \u2013 Tips, Tricks and Components\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#\/schema\/person\/e108e7d0e2204e7a4b30748b516741c8\",\"name\":\"Greytrix\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g\",\"caption\":\"Greytrix\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageintacct\/author\/sageintacct\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Query Method for Personalized Items","description":"Discover how to obtain the values for fields on related Custom Objects and apply them in filters by studying about query function examples on Custom Objects.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/","og_locale":"en_US","og_type":"article","og_title":"Query Method for Personalized Items","og_description":"Discover how to obtain the values for fields on related Custom Objects and apply them in filters by studying about query function examples on Custom Objects.","og_url":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/","og_site_name":"Sage Intacct \u2013 Tips, Tricks and Components","article_published_time":"2020-12-11T13:05:32+00:00","article_modified_time":"2024-07-01T12:06:51+00:00","og_image":[{"url":"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png","type":"","width":"","height":""}],"author":"Greytrix","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Greytrix","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/","url":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/","name":"Query Method for Personalized Items","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#primaryimage"},"thumbnailUrl":"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png","datePublished":"2020-12-11T13:05:32+00:00","dateModified":"2024-07-01T12:06:51+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#\/schema\/person\/e108e7d0e2204e7a4b30748b516741c8"},"description":"Discover how to obtain the values for fields on related Custom Objects and apply them in filters by studying about query function examples on Custom Objects.","breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#primaryimage","url":"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png","contentUrl":"https:\/\/www.greytrix.com\/blogs\/sagebusinesscloud\/wp-content\/uploads\/2020\/12\/query-custom-object.png"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/2020\/12\/11\/query-function-for-custom-objects\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/"},{"@type":"ListItem","position":2,"name":"Query Function for Custom Objects"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/","name":"Sage Intacct \u2013 Tips, Tricks and Components","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#\/schema\/person\/e108e7d0e2204e7a4b30748b516741c8","name":"Greytrix","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c3b4325cb326e36467f945b9b9adf2bb85e907fe092d42eb36b39743b492e626?s=96&d=mm&r=g","caption":"Greytrix"},"url":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/author\/sageintacct\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/posts\/2881","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/comments?post=2881"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/posts\/2881\/revisions"}],"predecessor-version":[{"id":6308,"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/posts\/2881\/revisions\/6308"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/media?parent=2881"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/categories?post=2881"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageintacct\/wp-json\/wp\/v2\/tags?post=2881"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}