{"id":24487,"date":"2024-02-15T14:53:34","date_gmt":"2024-02-15T22:53:34","guid":{"rendered":"https:\/\/docs.extraview.com\/v25\/book\/doload-1\/"},"modified":"2025-02-24T09:49:26","modified_gmt":"2025-02-24T17:49:26","slug":"doload-1","status":"publish","type":"page","link":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/","title":{"rendered":"doLoad"},"content":{"rendered":"<p>On all the key ExtraView screens, such as the <em>add<\/em> screen, the <em>edit<\/em> screen and the <em>query<\/em> screen, there is a standard JavaScript call in the ONLOAD attribute of the BODY tag within the HTML page. This call is to a method with the following signature:<\/p>\n<pre class=\"code\">\r\ndoLoad(document.editForm)<\/pre>\n<p>\n\tThe <span class=\"fixedWidthFont\">doLoad<\/span> method initializes several required elements of the form. In addition, this method calls a function within the UserJavaScript.js file. This method has the following signature:<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"code\">\r\nfunction userJavaScriptOnload(displayMode)<\/pre>\n<p>\n\tThis method need not exist in the UserJavaScript.js file. If it does exist it can be used to perform initialization functions to the administrator\u2019s specification. The parameter displayMode is used to help know which screen is being called. It can have the following values:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<table class=\"tableWithBorder\" width=\"80%\">\n<tbody>\n<tr class=\"tableHeaderRow\">\n<th width=\"15%\">\n\t\t\t\tValue<\/th>\n<th width=\"85%\">\n\t\t\t\tPurpose<\/th>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tADD<\/td>\n<td>\n\t\t\t\tThis shows that the add issue screen is being initiated<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tEDIT<\/td>\n<td>\n\t\t\t\tThis shows that the edit issue screen is being initiated<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tREFRESH<\/td>\n<td>\n\t\t\t\tThis shows that either the add or the edit screen is being refreshed<\/td>\n<\/tr>\n<tr>\n<td>\n\t\t\t\tSEARCH<\/td>\n<td>\n\t\t\t\tThis shows that the query or a report edit screen is being initiated<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>\n\tIn most cases an ExtraView business rule can be used to initiate values on a form, but in some cases you need more interaction than a rule can provide. The following example shows how an ActiveX control is called within the loading of an add screen, and populates values into fields on the form:<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<pre class=\"code\">\r\nfunction userJavaScriptOnload(displayMode) {\r\n\/\/ IE only function to activate an ActiveX control and take some \r\n\/\/ of the values and populate them into a form\r\n\/\/ Here we are getting the network hardware and configuration\r\n\/\/ information on the user's computer\r\n\t\r\n\/\/ For this to work, the host site being accessed by the client \r\n\/\/ must be a trusted site, and the security\r\n\/\/ settings for the trusted site zone must be altered to allow \r\n\/\/ ActiveX controls to run without hindrance\r\n  if (displayMode != \u2018ADD\u2019) return;\t\r\n  var locator = new ActiveXObject (\"WbemScripting.SWbemLocator\");\r\n  var service = locator.ConnectServer(\".\");\r\nvar properties = service.ExecQuery(\"SELECT * FROM Win32_NetworkAdapterConfiguration\");\r\n  var d = document.editForm;\r\n  var e = new Enumerator (properties);\r\n  for (;!e.atEnd();e.moveNext ()) {\r\n  \/\/ just take the first element returned and put into EV fields\r\n    var p = e.item ();\r\n    d.p_help_caption.value       = p.Caption;\r\n    d.p_help_description.value   = p.description;\r\n    d.p_help_dhcp_enabled.value  = p.DHCPEnabled;\r\n    d.p_help_dhcp_sever.value    = p.DHCPServer;\r\n    d.p_help_dns_host_name.value = p.DNSHostName;\r\n    d.p_help_ip_address.value    = p.IPAddress(0);\r\n    return;\r\n  }\r\n}<\/pre>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>On all the key ExtraView screens, such as the add screen, the edit screen and the query screen, there is a standard JavaScript call in the ONLOAD attribute of the BODY tag within the HTML page. This call is to a method with the following signature: doLoad(document.editForm) The doLoad method initializes several required elements of&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":24485,"menu_order":1,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_acf_changed":false,"_lmt_disableupdate":"no","_lmt_disable":"","_kad_blocks_custom_css":"","_kad_blocks_head_custom_js":"","_kad_blocks_body_custom_js":"","_kad_blocks_footer_custom_js":"","_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"footnotes":""},"class_list":["post-24487","page","type-page","status-publish","hentry"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>doLoad - Product Documentation<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"doLoad - Product Documentation\" \/>\n<meta property=\"og:description\" content=\"On all the key ExtraView screens, such as the add screen, the edit screen and the query screen, there is a standard JavaScript call in the ONLOAD attribute of the BODY tag within the HTML page. This call is to a method with the following signature: doLoad(document.editForm) The doLoad method initializes several required elements of...\" \/>\n<meta property=\"og:url\" content=\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/\" \/>\n<meta property=\"og:site_name\" content=\"Product Documentation\" \/>\n<meta property=\"article:modified_time\" content=\"2025-02-24T17:49:26+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data1\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/\",\"url\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/\",\"name\":\"doLoad - Product Documentation\",\"isPartOf\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#website\"},\"datePublished\":\"2024-02-15T22:53:34+00:00\",\"dateModified\":\"2025-02-24T17:49:26+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/docs.extraview.com\/v25\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"ExtraView 25\",\"item\":\"https:\/\/docs.extraview.com\/v25\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"User Custom Guide\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"JavaScript Interface\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/\"},{\"@type\":\"ListItem\",\"position\":5,\"name\":\"Support Methods\",\"item\":\"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/\"},{\"@type\":\"ListItem\",\"position\":6,\"name\":\"doLoad\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#website\",\"url\":\"https:\/\/docs.extraview.com\/v25\/\",\"name\":\"ExtraView Product Documentation\",\"description\":\"ExtraView Documentation\",\"publisher\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/docs.extraview.com\/v25\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#organization\",\"name\":\"ExtraView Corporation\",\"url\":\"https:\/\/docs.extraview.com\/v25\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png\",\"contentUrl\":\"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png\",\"width\":512,\"height\":512,\"caption\":\"ExtraView Corporation\"},\"image\":{\"@id\":\"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"doLoad - Product Documentation","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:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/","og_locale":"en_US","og_type":"article","og_title":"doLoad - Product Documentation","og_description":"On all the key ExtraView screens, such as the add screen, the edit screen and the query screen, there is a standard JavaScript call in the ONLOAD attribute of the BODY tag within the HTML page. This call is to a method with the following signature: doLoad(document.editForm) The doLoad method initializes several required elements of...","og_url":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/","og_site_name":"Product Documentation","article_modified_time":"2025-02-24T17:49:26+00:00","twitter_card":"summary_large_image","twitter_misc":{"Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/","url":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/","name":"doLoad - Product Documentation","isPartOf":{"@id":"https:\/\/docs.extraview.com\/v25\/#website"},"datePublished":"2024-02-15T22:53:34+00:00","dateModified":"2025-02-24T17:49:26+00:00","breadcrumb":{"@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/doload-1\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/docs.extraview.com\/v25\/"},{"@type":"ListItem","position":2,"name":"ExtraView 25","item":"https:\/\/docs.extraview.com\/v25\/"},{"@type":"ListItem","position":3,"name":"User Custom Guide","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/"},{"@type":"ListItem","position":4,"name":"JavaScript Interface","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/"},{"@type":"ListItem","position":5,"name":"Support Methods","item":"https:\/\/docs.extraview.com\/v25\/extraview-25\/user-custom-guide-1\/javascript-interface-1\/support-methods-1\/"},{"@type":"ListItem","position":6,"name":"doLoad"}]},{"@type":"WebSite","@id":"https:\/\/docs.extraview.com\/v25\/#website","url":"https:\/\/docs.extraview.com\/v25\/","name":"ExtraView Product Documentation","description":"ExtraView Documentation","publisher":{"@id":"https:\/\/docs.extraview.com\/v25\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/docs.extraview.com\/v25\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/docs.extraview.com\/v25\/#organization","name":"ExtraView Corporation","url":"https:\/\/docs.extraview.com\/v25\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/","url":"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png","contentUrl":"https:\/\/docs-stg.extraview.com\/wp-content\/uploads\/2024\/03\/favicon.png","width":512,"height":512,"caption":"ExtraView Corporation"},"image":{"@id":"https:\/\/docs.extraview.com\/v25\/#\/schema\/logo\/image\/"}}]}},"taxonomy_info":[],"featured_image_src_large":false,"author_info":{"display_name":"carl.koppel","author_link":"https:\/\/docs.extraview.com\/v25\/author\/carl-koppel\/"},"comment_info":0,"_links":{"self":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24487","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/comments?post=24487"}],"version-history":[{"count":0,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24487\/revisions"}],"up":[{"embeddable":true,"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/pages\/24485"}],"wp:attachment":[{"href":"https:\/\/docs.extraview.com\/v25\/wp-json\/wp\/v2\/media?parent=24487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}