Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the user-registration domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php on line 6121 Notice: Function _load_textdomain_just_in_time was called incorrectly. Translation loading for the hashone domain was triggered too early. This is usually an indicator for some code in the plugin or theme running too early. Translations should be loaded at the init action or later. Please see Debugging in WordPress for more information. (This message was added in version 6.7.0.) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php on line 6121 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 Warning: Cannot modify header information - headers already sent by (output started at /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/functions.php:6121) in /customers/c/c/d/ccloudonline.nl/httpd.www/wp-includes/rest-api/class-wp-rest-server.php on line 1896 {"id":1686,"date":"2019-12-11T12:32:05","date_gmt":"2019-12-11T12:32:05","guid":{"rendered":"http:\/\/ccloudonline.nl\/?p=1686"},"modified":"2019-12-18T21:30:19","modified_gmt":"2019-12-18T21:30:19","slug":"access-sobjects-names-dynamically-from-a-list","status":"publish","type":"post","link":"http:\/\/ccloudonline.nl\/?p=1686","title":{"rendered":"Access SObjects names dynamically from a List"},"content":{"rendered":"

Access SObjects names dynamically from a List<\/h3>\n

A simple way to do this is by using getSObjectType().getDescribe().getName();<\/strong>
\nYou can run that piece of code in your developer console.<\/p>\n

[code lang=”php”]
\n\/********************************************************************** *
\n* Access SObjects names dynamically from a List
\n************************************************************************\/<\/p>\n

List<SObject> objects = new List<SObject>();
\nAccount account = new Account(Name = ‘AccountSObject’);
\nContact contact = new Contact(LastName = ‘ContactSObject’);<\/p>\n

objects.add(account);
\nobjects.add(contact);
\nSystem.debug(objects.size());<\/p>\n

for(SObject sObjectNames : objects) {
\nString sObjName = sObjectNames.getSObjectType().getDescribe().getName();
\nSystem.debug(sObjName);
\n}
\n\/*
\n*
\n*\/
\n[\/code]<\/pre>\n","protected":false},"excerpt":{"rendered":"

Access SObjects names dynamically from a List A simple way to do this is by using getSObjectType().getDescribe().getName(); You can run that piece of code in your developer console. [code lang=”php”] \/********************************************************************** * * Access SObjects names dynamically from a List ************************************************************************\/ List<SObject> objects = new List<SObject>(); Account account = new Account(Name = ‘AccountSObject’); Contact contact […]<\/p>\n","protected":false},"author":1,"featured_media":641,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-1686","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-apex"],"_links":{"self":[{"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/posts\/1686","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1686"}],"version-history":[{"count":29,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/posts\/1686\/revisions"}],"predecessor-version":[{"id":2153,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/posts\/1686\/revisions\/2153"}],"wp:featuredmedia":[{"embeddable":true,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=\/wp\/v2\/media\/641"}],"wp:attachment":[{"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1686"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1686"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ccloudonline.nl\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1686"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}