{"id":834,"date":"2017-11-13T00:00:00","date_gmt":"2017-11-13T00:00:00","guid":{"rendered":"https:\/\/structr.com\/improvements-for-global-schema-methods\/"},"modified":"2025-03-15T12:53:12","modified_gmt":"2025-03-15T12:53:12","slug":"improvements-for-global-schema-methods","status":"publish","type":"post","link":"https:\/\/structr.com\/en\/blog\/improvements-for-global-schema-methods\/","title":{"rendered":"Improvements for Global Schema Methods"},"content":{"rendered":"<div class=\"wpb-content-wrapper\"><p>[vc_row][vc_column][vc_column_text]Global schema methods have existed for quite some time. Simply put, a global schema method is a special kind of custom schema method that is not associated with a type.<\/p>\n<p>In previous versions of Structr this feature was hidden away with no obvious UI to create, manage or execute global methods. They had to be created via the \u201cData\u201d section and were only<br \/>\nexecutable via the <a href=\"https:\/\/support.structr.com\/article\/128\"><code>call()<\/code><\/a> \/ <a href=\"https:\/\/support.structr.com\/article\/436\"><code>call_privileged()<\/code><\/a> functions or the Cron Service.<br \/>\nOver time global schema methods have received some love and are now a lot more accessible for backend users.<\/p>\n<h3 id=\"management-ui\">Management UI<\/h3>\n<p>A dedicated editor for global schema methods was added to the existing schema editor interface. Thus there is no need to leave the \u201cSchema\u201d section to create\/manage global schema methods.[\/vc_column_text][vc_single_image image=&#8221;1010&#8243; img_size=&#8221;large&#8221;][vc_single_image image=&#8221;1011&#8243; img_size=&#8221;large&#8221;][vc_column_text]<\/p>\n<h3 id=\"execution\">Execution<\/h3>\n<p>In Structr 2.2, another way to execute global schema methods has been introduced: Calling them via REST.<\/p>\n<p>Any administrative user can issue a POST to <code>maintenance\/globalSchemaMethods\/<\/code> and execute this method named <code><\/code>. Parameters can optionally be sent along and read in the method using <a href=\"https:\/\/support.structr.com\/article\/93\"><code>retrieve('')<\/code><\/a>.<\/p>\n<p>Along with this feature, a UI has been created which enables users to execute global schema methods from the \u201cDashboard\u201d in structr ui.[\/vc_column_text][vc_single_image image=&#8221;1008&#8243; img_size=&#8221;large&#8221;][vc_column_text]Any global schema can be run and the result is returned.[\/vc_column_text][vc_single_image image=&#8221;1009&#8243; img_size=&#8221;large&#8221;][vc_column_text]<\/p>\n<p>&nbsp;<\/p>\n<\/div>","protected":false},"excerpt":{"rendered":"<p>[vc_row][vc_column][vc_column_text]Global schema methods have existed for quite some time. Simply put, a global schema method is a special kind of \u2026<\/p>\n","protected":false},"author":4,"featured_media":2471,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[24,27,35],"tags":[450,420,449,424,455,454,453,448,423,451,452,405,414,281,457,456],"class_list":["post-834","post","type-post","status-publish","format-standard","hentry","category-structr","category-rest","category-ui","tag-api","tag-automation","tag-backend","tag-coding","tag-custommethods","tag-database","tag-datamanagement","tag-globalschemamethods","tag-it","tag-rest","tag-schemaeditor","tag-softwaredevelopment","tag-softwareengineering","tag-structr","tag-structrui","tag-ui"],"acf":[],"_links":{"self":[{"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/posts\/834","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/comments?post=834"}],"version-history":[{"count":7,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/posts\/834\/revisions"}],"predecessor-version":[{"id":2304,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/posts\/834\/revisions\/2304"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/media\/2471"}],"wp:attachment":[{"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/media?parent=834"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/categories?post=834"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/structr.com\/en\/wp-json\/wp\/v2\/tags?post=834"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}