{"id":30456,"date":"2021-10-31T12:42:20","date_gmt":"2021-10-31T12:42:20","guid":{"rendered":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/?p=30456"},"modified":"2025-07-09T10:19:17","modified_gmt":"2025-07-09T10:19:17","slug":"how-to-use-existing-accpac-advantage-session-in-c","status":"publish","type":"post","link":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/","title":{"rendered":"How to use Existing ACCPAC Advantage Session in C#"},"content":{"rendered":"\n<p>In this blog, we are going to define the use of an existing Sage 300c session with ACCPAC Advantage in C# .Net. We have seen that when we use ACCPAC Advantage DB link for opening ACCPAC Advantage View, we use session for initializing DB link instance I.e., object.<\/p>\n\n\n\n<p><strong><em><u>New Stuff:<\/u><\/em><\/strong>  <a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/sau-plugin-error-while-installing-sage-300-erp\/\" target=\"_blank\" rel=\"noreferrer noopener\">SAU Plugin error while installing Sage 300 ERP<\/a><\/p>\n\n\n\n<p>In this scenario we often create a new session which needs multiple parameters and may cause later in the form of an Error. To neglect error related to Session or DB link, we will use existing session of sage 300c.<\/p>\n\n\n\n<p>Following are the step to use Existing session of sage 300c.<\/p>\n\n\n\n<p>Step 1:<\/p>\n\n\n\n<p>Include the Sage 300 ACCPAC Advantage in the project.<\/p>\n\n\n\n<p>Step 2:<\/p>\n\n\n\n<p>Declare the static ACCPAC Advantage session in repository class<\/p>\n\n\n\n<p>(e.g., Repository_Sample) where we can access extended function of base(context).<\/p>\n\n\n\n<p>Step 3:<\/p>\n\n\n\n<p>Store the current session in an object of ACCPAC Advantage session I.e., Csession.<\/p>\n\n\n\n<p>Csession = (ACCPAC.Advantage.Session)base.Session.GetSession();<\/p>\n\n\n\n<p>Step 4:<\/p>\n\n\n\n<p>As we know that Csession is declared as static and we can access this wherever we want, so use this session for opening DBlink in any class.<\/p>\n\n\n\n<p>Csession = Repository_Sample&lt;&gt;.Csession;<\/p>\n\n\n\n<p>Csession.Errors.Clear();<\/p>\n\n\n\n<p>DBlink_object =Csession.OpenDBLink(DBLinkType.Company, DBLinkFlags.ReadWrite);<\/p>\n\n\n\n<p><span style=\"font-size: Medium;\"><strong>About Us<\/strong><\/span><\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\" target=\"_blank\" rel=\"noreferrer noopener\">Greytrix<\/a>&nbsp;&#8211; a globally recognized and one of the oldest Sage Development Partners is a one-stop solution provider for Sage ERP and Sage CRM organizational needs. Being acknowledged and rewarded for multi-man years of experience, we bring complete end-to-end assistance for your technical consultations, product customizations, data migration, system integrations, third-party add-on development, and implementation competence.<\/p>\n\n\n\n<p><a href=\"https:\/\/www.greytrix.com\/\">Greytrix<\/a>\u00a0offers unique <a href=\"https:\/\/www.greytrix.com\/gumu\/connectors\/\">GUMU&#x2122;<\/a> integrated solutions of\u00a0\u00a0<a href=\"https:\/\/www.greytrix.com\/salesforce-cloud-services\/sage-300-integration\/\">Sage 300 <\/a>with Sage CRM,\u00a0Salesforce(listed on Salesforce Appexchange), Dynamics 365 CRM, and\u00a0Magento eCommerce,\u00a0along with Sage 300 Migration from\u00a0<a href=\"https:\/\/www.greytrix.com\/sage-300-erp\/\">Sage 50 US, Sage 50 CA, Sage PRO, QuickBooks, Sage Business Vision and Sage Business <\/a><a href=\"https:\/\/www.greytrix.com\/resources\/sage-erp-crm-migration.pdf\">Works<\/a>. We also offer best-in-class\u00a0Sage 300 customization and development services\u00a0and integration services for applications such as\u00a0<a href=\"https:\/\/www.greytrix.com\/sage-300-erp\/\">POS | WMS | Payroll | Shipping System | Business Intelligence | eCommerce for Sage 300 ERP<\/a>\u00a0and for Sage 300c development services we offer, upgrades of older codes and screens to new web screens, latest integrations using Data and web services to Sage business partners, end users and Sage PSG worldwide. <\/p>\n\n\n\n<p>Greytrix offers 20+ add-ons for Sage 300 to enhance productivity such as\u00a0GreyMatrix,\u00a0Document Attachment,\u00a0Document Numbering,\u00a0Auto-Bank Reconciliation,\u00a0Purchase Approval System,\u00a0Three-way PO matching,\u00a0Bill of Lading,\u00a0and\u00a0VAT for the Middle East. The GUMU&#x2122; integration for Dynamics 365 CRM \u2013 Sage ERP is listed on Microsoft Appsource with an easy implementation package. <\/p>\n\n\n\n<p>The GUMU&#x2122; Cloud framework by Greytrix forms the backbone of cloud integrations that are managed in real-time for processing and execution of application programs at the click of a button. <\/p><p>For more details on Sage 300 and Sage 300c Services, please contact us at&nbsp;<a href=\"mailto:accpac@greytrix.com\">accpac@greytrix.com<\/a>, We will like to hear from you.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this blog, we are going to define the use of an existing Sage 300c session with ACCPAC Advantage in C# .Net. We have seen that when we use ACCPAC Advantage DB link for opening ACCPAC Advantage View, we use session for initializing DB link instance I.e., object. New Stuff: SAU Plugin error while installing\u2026 <span class=\"read-more\"><a href=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/\">Read More &raquo;<\/a><\/span><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,5],"tags":[79,3817,2324,2357,2451],"class_list":["post-30456","post","type-post","status-publish","format-standard","hentry","category-sage-accpac","category-accpac-sdk","tag-accpac","tag-existing-accpac-advantage-session-in-c","tag-sage-300","tag-sage-300-erp","tag-sage-accpac-erp"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.3 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Use Existing ACCPAC Advantage Session in C#<\/title>\n<meta name=\"description\" content=\"Learn how to utilize an existing ACCPAC Advantage session in C# to enhance integration and streamline Sage 300 custom development.\" \/>\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\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Use Existing ACCPAC Advantage Session in C#\" \/>\n<meta property=\"og:description\" content=\"Learn how to utilize an existing ACCPAC Advantage session in C# to enhance integration and streamline Sage 300 custom development.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/\" \/>\n<meta property=\"og:site_name\" content=\"Sage 300 ERP \u2013 Tips, Tricks and Components\" \/>\n<meta property=\"article:published_time\" content=\"2021-10-31T12:42:20+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-07-09T10:19:17+00:00\" \/>\n<meta name=\"author\" content=\"Greytrix\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Greytrix\" \/>\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\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/\",\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/\",\"name\":\"Use Existing ACCPAC Advantage Session in C#\",\"isPartOf\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website\"},\"datePublished\":\"2021-10-31T12:42:20+00:00\",\"dateModified\":\"2025-07-09T10:19:17+00:00\",\"author\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2\"},\"description\":\"Learn how to utilize an existing ACCPAC Advantage session in C# to enhance integration and streamline Sage 300 custom development.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to use Existing ACCPAC Advantage Session in C#\"}]},{\"@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\/93977cd8aa8fbd1f151d3f664e29c9f2\",\"name\":\"Greytrix\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g\",\"caption\":\"Greytrix\"},\"url\":\"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/greytrix\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Use Existing ACCPAC Advantage Session in C#","description":"Learn how to utilize an existing ACCPAC Advantage session in C# to enhance integration and streamline Sage 300 custom development.","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\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/","og_locale":"en_US","og_type":"article","og_title":"Use Existing ACCPAC Advantage Session in C#","og_description":"Learn how to utilize an existing ACCPAC Advantage session in C# to enhance integration and streamline Sage 300 custom development.","og_url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/","og_site_name":"Sage 300 ERP \u2013 Tips, Tricks and Components","article_published_time":"2021-10-31T12:42:20+00:00","article_modified_time":"2025-07-09T10:19:17+00:00","author":"Greytrix","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Greytrix","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/","url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/","name":"Use Existing ACCPAC Advantage Session in C#","isPartOf":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#website"},"datePublished":"2021-10-31T12:42:20+00:00","dateModified":"2025-07-09T10:19:17+00:00","author":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/93977cd8aa8fbd1f151d3f664e29c9f2"},"description":"Learn how to utilize an existing ACCPAC Advantage session in C# to enhance integration and streamline Sage 300 custom development.","breadcrumb":{"@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/2021\/10\/31\/how-to-use-existing-accpac-advantage-session-in-c\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/"},{"@type":"ListItem","position":2,"name":"How to use Existing ACCPAC Advantage Session in C#"}]},{"@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\/93977cd8aa8fbd1f151d3f664e29c9f2","name":"Greytrix","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3cdb553d6ca07df0e407d5e092f2410d163e0fd40b27734b345b04c8f0786969?s=96&d=mm&r=g","caption":"Greytrix"},"url":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/author\/greytrix\/"}]}},"_links":{"self":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/30456","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\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/comments?post=30456"}],"version-history":[{"count":1,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/30456\/revisions"}],"predecessor-version":[{"id":30462,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/posts\/30456\/revisions\/30462"}],"wp:attachment":[{"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/media?parent=30456"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/categories?post=30456"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.greytrix.com\/blogs\/sageaccpacerp\/wp-json\/wp\/v2\/tags?post=30456"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}