{"id":151,"date":"2012-01-20T06:46:54","date_gmt":"2012-01-20T06:46:54","guid":{"rendered":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?p=151"},"modified":"2025-05-28T04:42:04","modified_gmt":"2025-05-28T04:42:04","slug":"how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/","title":{"rendered":"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)"},"content":{"rendered":"<p>As per the available resource of SWT workshop you can easily create a Form with label, Text box etc. But suppose we need the functionality to add new\/delete button in a form, in this case refer the below code to achieve the functionality.<br \/>\n<strong>Example:<\/strong><br \/>\nBelow shown is the state code form, the objects used in Navigation, Load button and Save are the ones which we are aware of but apart from this we have added 2 extra buttons i.e. <strong>New button and Delete button.<\/strong><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-152\" src=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp\" alt=\"\" \/><\/a><br \/>\nThe below XML code shows the snippet of code which adds the New Button within the screen. You can add the button either by using this xml code given below OR by using SWT UI Editor:<br \/>\n&lt;widget type=&#8221;swt:SwtButton&#8221; id=&#8221;insertButton&#8221; hAlignInParent=&#8221;Default&#8221; vAlignInParent=&#8221;Top&#8221; datasourceID=&#8221;&#8221; preferencestoreID=&#8221;&#8221; helpID=&#8221;&#8221; height=&#8221;26&#8243; width=&#8221;50&#8243; accessKey=&#8221; &#8220;&gt;<br \/>\n&lt;title&gt;<br \/>\n&lt;transText text=&#8221;&#8221; textID=&#8221;&#8221;\/&gt;<br \/>\n&lt;\/title&gt;<br \/>\n&lt;caption isHTML=&#8221;false&#8221;&gt;<br \/>\n&lt;transText text=&#8221;New&#8221; textID=&#8221;&#8221;\/&gt;<br \/>\n&lt;\/caption&gt;<br \/>\n&lt;handlers&gt;<br \/>\n&lt;handler event=&#8221;click&#8221; action=&#8221;insert&#8221;&gt;<br \/>\n&lt;params&gt;<br \/>\n&lt;param id=&#8221;datasourceID&#8221; value=&#8221;dtstatecode&#8221;\/&gt;<br \/>\n&lt;\/params&gt;<br \/>\n&lt;\/handler&gt;<br \/>\n&lt;\/handlers&gt;<br \/>\n&lt;\/widget&gt;<br \/>\n<strong>Below given are list of Actions and their description with the required parameters for click event, which are used for Insertion and Deletion of the records.<\/strong><br \/>\n<strong><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image2.bmp\"><img decoding=\"async\" class=\"aligncenter size-full wp-image-153\" src=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image2.bmp\" alt=\"\" \/><\/a><\/strong>The actions mentioned in the above table is used as per requirement<br \/>\n<strong>Action for Saving New Record<\/strong>:\u00a0 If we want to insert the new data into the table then we can use combination of two actions \u201cmoveToInsert\u201d and then \u201cSave\u201d action OR \u00a0using only \u201cinsert\u201d action.<br \/>\n<strong>Action for Delete Entry:\u00a0 <\/strong>If we want to delete entry from table we can use delete action. We can use the \u201cdeletePrompt\u201d OR \u201cdeleteEntityPrompt\u201d actions to prompt a warning before delete action are executed.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As per the available resource of SWT workshop you can easily create a Form with label, Text box etc. But suppose we need the functionality to add new\/delete button in a form, in this case refer the below code to achieve the functionality. Example: Below shown is the state code form, the objects used in\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[412,1008,1458,2793],"class_list":["post-151","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","tag-button","tag-form","tag-label","tag-swt"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)<\/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\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)\" \/>\n<meta property=\"og:description\" content=\"As per the available resource of SWT workshop you can easily create a Form with label, Text box etc. But suppose we need the functionality to add new\/delete button in a form, in this case refer the below code to achieve the functionality. Example: Below shown is the state code form, the objects used in\u2026 Read More &raquo;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2012-01-20T06:46:54+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-05-28T04:42:04+00:00\" \/>\n<meta property=\"og:image\" content=\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp\" \/>\n<meta name=\"author\" content=\"sage300\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"sage300\" \/>\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\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/\",\"name\":\"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#primaryimage\"},\"thumbnailUrl\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp\",\"datePublished\":\"2012-01-20T06:46:54+00:00\",\"dateModified\":\"2025-05-28T04:42:04+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\"},\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#primaryimage\",\"url\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp\",\"contentUrl\":\"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\",\"name\":\"Sage 300 ERP \u2013 Tips, Tricks and Components\",\"description\":\"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! \",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?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\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5\",\"name\":\"sage300\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/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\":\"sage300\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)","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\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/","og_locale":"en_US","og_type":"article","og_title":"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)","og_description":"As per the available resource of SWT workshop you can easily create a Form with label, Text box etc. But suppose we need the functionality to add new\/delete button in a form, in this case refer the below code to achieve the functionality. Example: Below shown is the state code form, the objects used in\u2026 Read More &raquo;","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2012-01-20T06:46:54+00:00","article_modified_time":"2025-05-28T04:42:04+00:00","og_image":[{"url":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp","type":"","width":"","height":""}],"author":"sage300","twitter_card":"summary_large_image","twitter_misc":{"Written by":"sage300","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/","name":"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#primaryimage"},"image":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#primaryimage"},"thumbnailUrl":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp","datePublished":"2012-01-20T06:46:54+00:00","dateModified":"2025-05-28T04:42:04+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5"},"breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#primaryimage","url":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp","contentUrl":"http:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-content\/uploads\/2012\/01\/Image1.bmp"},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2012\/01\/20\/how-to-achieve-newdelete-button-functionality-in-swt-sage-web-toolkit\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"How to achieve New\/Delete Button functionality in SWT (Sage Web Toolkit)"}]},{"@type":"WebSite","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/","name":"Sage 300 ERP \u2013 Tips, Tricks and Components","description":"Explore the world of Sage 300 with our insightful blogs, expert tips, and the latest updates. We\u2019ll empower you to leverage Sage 300 to its fullest potential. As your one-stop partner, Greytrix delivers exceptional solutions and integrations for Sage 300. Our blogs extend our support to businesses, covering the latest insights and trends. Dive in and transform your Sage 300 experience with us! ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?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\/sageaccpacerp\/#\/schema\/person\/1aced4e22c30ccf606960de27c9542f5","name":"sage300","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/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":"sage300"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/sageaccpac\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/151","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=151"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/151\/revisions"}],"predecessor-version":[{"id":35405,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/151\/revisions\/35405"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=151"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=151"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=151"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}