{"id":9229,"date":"2014-12-08T06:07:41","date_gmt":"2014-12-08T06:07:41","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/?p=9229"},"modified":"2014-12-08T06:07:41","modified_gmt":"2014-12-08T06:07:41","slug":"tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/","title":{"rendered":"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2"},"content":{"rendered":"<p>Even from Technical Point of view Sage CRM is very much capable to handle various critical solutions. We have already posted few blogs about writing JavaScript codes in .js files and calling the same in <strong>Custom Content<\/strong> of any screen. This blog explains such a nice and timesaving trick to call JavaScript function written in any JavaScript file under root directory of CRM.<br \/>\n<span style=\"color: #993300;\"><em><strong>New Stuff:<\/strong><\/em><\/span> <a title=\"Make your keyword search more efficient\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/03\/make-your-keyword-search-more-efficient\/\" target=\"_blank\">Make your keyword search more efficient<\/a><br \/>\nNormally I follow mechanism where I used to create a new JavaScript file under root directory of CRM, write all client side code in it and then call the function by specifying function name and path of the file in Custom Content. Below screenshot will give you clear idea about what I am talking.<br \/>\n<a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg\" target=\"_blank\"><img decoding=\"async\" class=\"aligncenter wp-image-9230 size-full\" src=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg\" alt=\"Screenshot1\" width=\"223\" height=\"188\" \/><\/a><br \/>\nWhile working on Sage CRM, I came across one scenario where my <strong>Case<\/strong> entity functionality was working fine on Internet Explorer browser but not in Chrome. That functionality was totally based on code written in one of the JavaScript function and through <strong>Custom Content<\/strong> of the screen I was calling the same.<br \/>\nI tried couple of basic solutions like to check language syntax, file path etc. but none of these were working. After debugging the code and from internet help I came to know about one new feature which will be a great help for any developer of course if he doesn\u2019t know about this. \ud83d\ude42<br \/>\nBasically the idea is to create JavaScript file under CRM root directory i.e. at \u201cWWWRoot\\js\\custom\u201d. Write all your functions here and then you just need to specify <strong>function name<\/strong> in Custom Content of any screen and not the path of the file. This is applicable throughout the CRM for any screen and the biggest advantage is, it works in every major browser like IE, Chrome, firefox etc. without any flaw. I just use below JavaScript syntax and put it Custom Content of screen \u201c<strong>CaseDetailBox<\/strong>\u201d. Refer below sample code snippet.<br \/>\n<em>&lt; SCRIPT &gt;<\/em><br \/>\n<em>if(typeof window.addEventListener != &#8216;undefined&#8217;)<\/em><br \/>\n<em>window.addEventListener(&#8220;load&#8221;,SMTCase, false);<\/em><br \/>\n<em>else if(window.attachEvent) <\/em><br \/>\n<em>window.attachEvent(&#8220;onload&#8221;,SMTCase)<\/em><br \/>\n<em>}<\/em><br \/>\n<em>&lt;\/SCRIPT&gt;<\/em><br \/>\n<span style=\"color: #993300;\"><em><strong>Also Read:<\/strong><\/em><\/span><br \/>\n1) <a title=\"Use of AttachEvent on window in Custom Content\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2009\/08\/25\/use-of-attachevent-on-window-in-custom-content\/\" target=\"_blank\">Use of AttachEvent on window in Custom Content<\/a><br \/>\n2) <a title=\"How do you find the Workflow Action Buttons from custom content?\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2009\/04\/20\/how-do-you-find-the-workflow-action-buttons-from-custom-content\/\" target=\"_blank\">How do you find the Workflow Action Buttons from custom content?<\/a><br \/>\n3) <a title=\"How do you call the custom page to write your custom content?\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2009\/03\/07\/how-do-you-call-the-custom-page-to-write-your-custom-content\/\" target=\"_blank\">How do you call the custom page to write your custom content?<\/a><br \/>\n4) <a title=\"JavaScript to Calculate days difference between dates (Duration)\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2012\/06\/01\/javascript-to-calculate-days-difference-between-dates-duration\/\" target=\"_blank\">JavaScript to Calculate days difference between dates (Duration)<\/a><br \/>\n5) <a title=\"Run the External JavaScript file in 64-bit Operating system\" href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2012\/03\/20\/run-the-external-javascript-file-in-64-bit-operating-system\/\" target=\"_blank\">Run the External JavaScript file in 64-bit Operating system<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Even from Technical Point of view Sage CRM is very much capable to handle various critical solutions. We have already posted few blogs about writing JavaScript codes in .js files and calling the same in Custom Content of any screen. This blog explains such a nice and timesaving trick to call JavaScript function written in\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[73,83,95,98,199,200,202,204,332,352,1],"tags":[740,797,855,1471,1475,1477],"class_list":["post-9229","post","type-post","status-publish","format-standard","hentry","category-configuration","category-crm72","category-custom-page-sage-crm","category-customization","category-javapath","category-javascript-sage-crm","category-jquey","category-js-file","category-sage-crm","category-script","category-uncategorized","tag-configuration","tag-crm-72","tag-custom-content","tag-javascript","tag-jquery","tag-js-file"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2 - Sage CRM \u2013 Tips, Tricks and Components<\/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:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2 - Sage CRM \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"og:description\" content=\"Even from Technical Point of view Sage CRM is very much capable to handle various critical solutions. We have already posted few blogs about writing JavaScript codes in .js files and calling the same in Custom Content of any screen. This blog explains such a nice and timesaving trick to call JavaScript function written in\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage CRM \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2014-12-08T06:07:41+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg\" \/>\n<meta name=\"author\" content=\"greysagecrm\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"greysagecrm\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/\",\"name\":\"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2 - Sage CRM \u2013 Tips, Tricks and Components\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg\",\"datePublished\":\"2014-12-08T06:07:41+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#primaryimage\",\"url\":\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg\",\"contentUrl\":\"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/\",\"name\":\"Sage CRM \u2013 Tips, Tricks and Components\",\"description\":\"Explore the possibilities with Sage CRM insights through our comprehensive blogs. As a leading Sage partner, Greytrix helps businesses maximize their Sage CRM potential with its rich expertise and immense knowledge. Here, you will find blogs that feature expert advice, tips &amp; tricks, best practices, and comprehensive guides on customizing and configuring Sage CRM for your business. Stay informed with our regular updates and expert insights!\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/?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\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f\",\"name\":\"greysagecrm\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/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\":\"greysagecrm\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sagecrm\/author\/greysagecrm\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2 - Sage CRM \u2013 Tips, Tricks and Components","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\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/","og_locale":"en_US","og_type":"article","og_title":"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2 - Sage CRM \u2013 Tips, Tricks and Components","og_description":"Even from Technical Point of view Sage CRM is very much capable to handle various critical solutions. We have already posted few blogs about writing JavaScript codes in .js files and calling the same in Custom Content of any screen. This blog explains such a nice and timesaving trick to call JavaScript function written in\u2026 Read More &raquo;","og_url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/","og_site_name":"Sage CRM \u2013 Tips, Tricks and Components","article_published_time":"2014-12-08T06:07:41+00:00","og_image":[{"url":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg","type":"","width":"","height":""}],"author":"greysagecrm","twitter_card":"summary_large_image","twitter_misc":{"Written by":"greysagecrm","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/","url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/","name":"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2 - Sage CRM \u2013 Tips, Tricks and Components","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#primaryimage"},"thumbnailUrl":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg","datePublished":"2014-12-08T06:07:41+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f"},"breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#primaryimage","url":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg","contentUrl":"http:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-content\/uploads\/2014\/12\/Screenshot1.jpg"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/2014\/12\/08\/tips-and-tricks-about-calling-function-in-custom-content-of-sage-crm-7-2\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/"},{"@type":"ListItem","position":2,"name":"Tips and Tricks about Calling function in Custom Content of Sage CRM 7.2"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/","name":"Sage CRM \u2013 Tips, Tricks and Components","description":"Explore the possibilities with Sage CRM insights through our comprehensive blogs. As a leading Sage partner, Greytrix helps businesses maximize their Sage CRM potential with its rich expertise and immense knowledge. Here, you will find blogs that feature expert advice, tips &amp; tricks, best practices, and comprehensive guides on customizing and configuring Sage CRM for your business. Stay informed with our regular updates and expert insights!","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/?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\/sagecrm\/#\/schema\/person\/e7ff1c8f4763b47730d6bc5e74d59c1f","name":"greysagecrm","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/#\/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":"greysagecrm"},"url":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/author\/greysagecrm\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/posts\/9229","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/comments?post=9229"}],"version-history":[{"count":0,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/posts\/9229\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/media?parent=9229"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/categories?post=9229"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sagecrm\/wp-json\/wp\/v2\/tags?post=9229"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}