{"id":117,"date":"2012-03-06T06:33:24","date_gmt":"2012-03-06T01:33:24","guid":{"rendered":"http:\/\/learnsf.wordpress.com\/?p=117"},"modified":"2012-03-06T06:33:24","modified_gmt":"2012-03-06T01:33:24","slug":"my-1st-little-app-exchange-soql-query-tool","status":"publish","type":"post","link":"https:\/\/blog.felineflock.com\/index.php\/2012\/03\/06\/my-1st-little-app-exchange-soql-query-tool\/","title":{"rendered":"My 1st little App Exchange:   SOQL Query Tool"},"content":{"rendered":"<p>As a little exercise, I&#8217;ve created a small tool comprised of a VisualForce page\/tab that allows system administrators to run ad-hoc SOQL (SOSL and aggregate queries) from within their applications and do mass update on every page of 100 records. Basically, it reproduces a little of the functionality of the DeveloperForce utility <strong><a title=\"Mass Update Anything\" href=\"http:\/\/wiki.developerforce.com\/page\/Mass_Update_Anything\" target=\"_blank\" rel=\"noopener\">Mass Update Anything<\/a><\/strong>.<\/p>\n<p>This tool is available at the AppExchange for free: \u00a0\u00a0<strong><a title=\"goo.gl\/90V8f\" href=\"http:\/\/goo.gl\/90V8f\">goo.gl\/90V8f<\/a><\/strong><\/p>\n<p>(The listing is private because SalesForce seems to only allow SalesForce Pardners &#8211; that is, companies &#8211; to take their apps to security review and make them public.)<\/p>\n<figure style=\"width: 1014px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/blog.felineflock.com\/wp-content\/uploads\/2012\/03\/soqltool.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\" wp-image\" title=\"SOQL Query Tool\" src=\"http:\/\/blog.felineflock.com\/wp-content\/uploads\/2012\/03\/soqltool.jpg?w=1014\" alt=\"SOQL Query Tool screenshot\" width=\"1014\" height=\"497\" \/><\/a><figcaption class=\"wp-caption-text\">The results of an ad-hoc query executed in SOQL Query Tool (click to expand).<\/figcaption><\/figure>\n<p>In one class I used <em><strong>ApexPages.StandardSetController<\/strong><\/em> with a <em><strong>Database.<\/strong><strong>QueryLocator<\/strong><\/em> to implement pagination of the query results.<\/p>\n<pre style=\"padding-left:30px;\">objStdSetCtrl\u00a0=\u00a0new\u00a0ApexPages.StandardSetController(\u00a0Database.getQueryLocator(\u00a0SOQLText\u00a0)\u00a0);<\/pre>\n<p>In the VisualForce page I used the tag<strong><em> apex:repeat<\/em> <\/strong>to display a dynamic list of columns\u00a0nested in an <strong><em>apex:pageBlockTable<\/em><\/strong>\u00a0that iterates on the query results&#8217; rows.<\/p>\n<pre style=\"padding-left:30px;\">&lt;<strong>apex:pageBlockTable<\/strong> id=\"ResultsTbl\" value=\"{!QryResults}\" var=\"row\"&gt;\n    &lt;<strong>apex:repeat<\/strong> id=\"ColumnsRpt\" value=\"{!LstColNames}\" var=\"col\"&gt;\n         &lt;apex:column &gt;\n                {!col}\n                &lt;apex:<span class=\"hiddenSpellError\">outputLink rendered=\"{!( col == 'Id' || col == 'Name' )}\" value=\"\/{!row.id}\" target=\"new\"&gt;\n &lt;apex:<span class=\"hiddenSpellError\">outputText value=\"{!row[col]}\" \/&gt;<\/span><\/span><\/pre>\n<pre style=\"padding-left:30px;\">...<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>As a little exercise, I&#8217;ve created a small tool comprised of a VisualForce page\/tab that allows system administrators to run ad-hoc SOQL (SOSL and aggregate queries) from within their applications and do mass update on every page of 100 records. Basically, it reproduces a little of the functionality of the DeveloperForce utility Mass Update Anything. [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"footnotes":""},"categories":[7,13,16],"tags":[],"class_list":["post-117","post","type-post","status-publish","format-standard","hentry","category-data-cleansing","category-no-category","category-soql"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/posts\/117","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/comments?post=117"}],"version-history":[{"count":0,"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/posts\/117\/revisions"}],"wp:attachment":[{"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/media?parent=117"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/categories?post=117"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.felineflock.com\/index.php\/wp-json\/wp\/v2\/tags?post=117"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}