Sage 300 2020 Web SDK

Introduction

The Sage 300 Web SDK (SDK) is a collection of wizards, utilities, samples and documentation for developing Web Screens for the Sage 300 Application.

This week we released the Sage 300 2020 Web SDK to coincide with the release of the Sage 300 2020 Application.

It’s Available!

The SDK is available at https://github.com/SageNADev/Sage300-SDK.

Branches

As described in a previous blog and in the README file in the root of the repository, the branches contain the different versions of the SDK.

master

Contains the current version of the SDK (2020).

develop

Contains the in-progress version of the SDK (2020.1).

release-…

Contains the previous versions of the SDK (release-2017, release-2017.1, release-2017.2, release-2018, release-2018.1, release-2018.2, release-2019, release-2019.1, release-2019.2)

What’s New

Documentation

Updated documentation is available.

In the docs\upgrades folder is a document for the upgrade procedures for moving partner source from Sage 300 2019.2 to Sage 300 2020. There is a manual step in the upgrade process, so please familiarize yourself with the upgrade steps.

In the docs\development folder you will find the updated Developing New Application document that discusses and Security Resource Keys having a NONE value and the semantics for the AND and OR notation.

The docs\presentations folder has been updated and includes a PowerPoint presentation for what’s new in the SDK for 2020.

Visual Studio 2019

All wizard manifests have been revised to include Visual Studio 2019 as a target IDE.

Blog201.png

Visual Studio 2017 and Visual Studio 2019 are now supported targets.

Version Change

The Accpac.Advantage and Accpac.Advantage.Types versions are now 6.7.0.0 and all the AccpacDotNetVersion.props files for the source and samples have been updated.

 

Blog202.png

Visual Studio 2019 is now supported for web development and the .NET Framework remains at 4.7.2

Samples

The samples have been updated with new global references and modifications to support the new multiple session behavior.

The Segment Codes sample has been re-factored to use the new grid.

Solution Wizard

References to the global files were updated and a UI update added the Metro Modern UI Framework for an updated, consistent, and a Sage branded look and feel:

Blog203

The wizard is compatible with Visual Studio 2017 and Visual Studio 2019.

Customization Wizard

 References to the global files were updated and a UI update added the Metro Modern UI Framework for an updated, consistent, and a Sage branded look and feel:

Blog204

The Default Compatibility level was changed from 6.6A+ to 6.7A+.

The wizard is compatible with Visual Studio 2017 and Visual Studio 2019.

Code Generation Wizard

 References to the global files were updated and a UI update added the Metro Modern UI Framework for an updated, consistent, and a Sage branded look and feel:

Blog205.png

The wizard is compatible with Visual Studio 2017 and Visual Studio 2019.

Several items were addressed this release:

  • If wizard version does not match the Sage 300 Version, the wizard simply aborted
    • Added dialog for this scenario for developer to install the correct version of the wizard
  • Multiple Session Changes
    • With the ability in this version to run Sage 300 Web Screens in multiple tabs of the same browser, changes to support this behavior were required in the following files:
      • XXAreaRegistration.cs
      • Global.asax.cs
      • Web.config
      • PageUrl.txt
      • ..Behaviour.js
  • Added the ability to generate a grid for a Flat Code Type screen
    • The Accpac View must be Flat View and be a Revision List
      • #define FLAT_VIEW 1
      • #define HAS_REVSIONS 2

Blog206.png

Blog207.png

Upgrade Wizard

 References to the global files were updated and a UI update added the Metro Modern UI Framework for an updated, consistent, and a Sage branded look and feel:

Blog208

The wizard is compatible with Visual Studio 2017 and Visual Studio 2019.

With the ability in this version to run Sage 300 Web Screens in multiple tabs of the same browser, manual changes (documented in the docs/upgrade folder) to support this behavior are required in the following files:

      • XXAreaRegistration.cs
      • Global.asax.cs
      • Web.config
      • PageUrl.txt
      • ..Behaviour.js

 

Inquiry Configuration Wizard

No changes this release.

MergeISVProject Executable

This utility is a post-build utility used by various wizards and the generated partner solution to pre-compile Razor Views and deploy assets to a local Sage 300 installation for developer testing.

An issue was discovered where it failed during the minification operation if a space was present in the file path. This has been addressed.

For the upcoming 2020.1 release, an enhancement will be made to the utility to copy all external files in the projects required for the asp_compile.exe to perform without issue (not all manually added external developer references are currently copied).

Partner Enhancements in the Application

The following partner requests/suggestions have been added to the application to better support developer requirements:

  • Unhandled errors in the web screens are now logged in the trace.log file with the error stack
  • Issues for the grid and finder released in 2019.2 have been addressed
  • Mask issues in the finder have been addressed
  • Exception logging in the Business Entity Session now includes the error stack
  • IE11 has been removed as a supported browser for web screens
  • The “NONE” security resource key in the menu XML files to properly result in the menu item always showing regardless of security permissions of the user
  • The Instrumentation page (Core/Instrumentation) is available to display session resources used by the web screens

Desktop SDK CHM Files

Sage 300 is eliminating the delivery of CHM files starting with the 2020 release.

The Web SDK GitHub Repository is the perfect place to store these CHM and HTML help files. The Desktop SDK has been modified to point to the ‘master’ branch in the repository for these files:

Blog209.png

The files in the help/classic folder:

  • ACCPACControlsRef.chm
  • AccpacCOMAPI.chm
  • CViewChanges.zip (html files)
  • SDK-HELP.chm
  • TemplateQuickReference.zip (html files)

As with any file downloaded from the Internet, there is a possibility that the downloaded or cloned CHM and ZIP file may be blocked as the file system could detect that the files came from another computer and is protecting your computer.

If the CHM or ZIP file is blocked, simply access the properties of the file and select the “Unblock” checkbox.

 

Web API Sample POST Payloads

Sample POST payloads are now included in the samples/WebAPI_SamplePostPayloads folder and have sub-folders by module. These samples are great examples and learning tools for interacting with our Web API:

Blog2010.png

Multiple Sessions

Blog2011

Prior to 2020, the Sage 300 web screens could only be run in a single tab within a browser instance. This was because we stored a single key in the IIS Session Cache to identify the Sage 300 screen. Therefore, this mechanism made it impossible for multiple screens to be running at the same time since each screen would need to access the cache to ask, “who am i?”.

A new mechanism was required to allow Sage 300 to run in multiple tab pages with multiple contexts (user – company combinations):

  • A new segment was added to the URL
    • This session segment is an encoded value for the user-company combination

Blog2012.png

  • Each browser is sandboxed from other browsers
  • Each tab page is “partly” sandboxed from other tab pages
    • Each user-company combination is unique
  • Logging out will logout other tab pages in the same browser with the same user-company context, if they exist
    • There will only be a single warning from the main tab page
    • The Dirty flags will be ignored in the other tab pages

Blog2013.png

  • All ..Behaviour.js files were modified to invoke the PageUnloadManager in the window’s “beforeunload” event in order to properly skip the dirty checks if the screen is being unloaded from another tab pages logout

LanPak Licensing for the Web Screens

Prior to 2020, there were no LanPak checks in the web screens.

LanPak checks will be performed in the web screens:

  • A browser instance will be considered a sandbox. For example, if a user is logged into a web screen in Chrome as User1 – Company1, this will consume 1 license. If this same user was logged into Firefox, this would consume another license.
  • The browser instance will consider 1 license to be consumed for the same user regardless of how many tab pages it is used in.
    • For example, if User1 opens Company1, Company2, Company1, Company3 in 4 tab pages, this will be considered a single LanPak license.
    • For example, if User1 is logged in on tab 1 and user2 is logged in on tab page 2, this will consume 2 LanPak licenses.
  • There are several areas that still do not require LanPak licenses:
    • Web API
    • Sage 300 Web Screens invoked from CRM Integration
    • Payroll Timecard Web Screen

The Current User screen in the Desktop has been enhanced to show the web screen users:

Blog2014.png

User Eviction for Web Screens is coming in 2020.1

Coming in 2020.1

As a quick preview, here’s some of the items we will be working on for the 2020.1 release:

  • Web API
    • Better batch logic (all or nothing) (starting with AR Invoice)
    • Proper invalid error message when the payload contains an invalid item number
    • New Companies List endpoint
    • New CRM bi-directional endpoints as needed
  • Web SDK
    • Enhancement to open a view more than once in the business repository
    • Enhancement to provide a programmatic interface for displaying popups
    • Enhancement to the finder
      • Adding an Id property
      • Direct/Expanded interface without stacking parameters
      • Binding a ko.computed property to a label
      • Unifying the disable/disabled logic
      • Performance enhancement to the RVSpy utility
  • Application
    • PDX Improvements
      • Browser Icons, Menu Icons, Submenus, Signpost on Dashboard
    • Evict User from Web Screens
      • Using SignalR to free LanPaks and users from web
    • Multiple Contacts
      • Customer and Vendor (new MT module with backwards compatibility plus innovation)
    • CRM bi-directional integration

Summary

The Sage 300 2020 SDK is released and ready to be downloaded!

Documentation updates, the ability to run the wizards in Visual Studio 2017 or 2019, new grid implementation in the Segment Code sample, the ability to generate a grid for a Flat Code Type screen, synchronization of global files and references in the wizards, Sample POST Payloads, Desktop CHM files, and the multiple session enhancements are some of the features and enhancements in the Web SDK.

For functionality, documentation, tutorials, enhancements, etc. that are not currently in the SDK which should be there to better assist with efficient development practices and time-to-market considerations, please contact the Sage 300 Product Manager. The partners voice and feedback resound the loudest!

We continue to look forward to addressing the needs and expectations of the Sage partner community and ecosystem.

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

Advertisements

Sage 300 Unicode Support in the Web Screens

Introduction

Sage 300 supports English, French, Spanish, Traditional Chinese, and Simplified Chinese languages.

Customers, using non-English languages in the Web Screens, may encounter pain points in the following areas:

  1. Different languages between the SQL Server database and the application server’s system locale
  2. Different languages between the Sage 300 user’s language (locale) and the application server’s system locale
  3. Non-English characters in key or coded fields

Sage 300 Architecture

The SQL Server database tables for Sage 300 are not configured for Unicode support, and non-English characters are saved as ASCII in the database. The business views, which handle all database transactions and business logic, rely on the locale setting to convert the characters. As such,

  • ​The application server’s system locale must match the same language as the data in the database
  • The database collation should also match for proper sorting in that language
  • The Sage 300 user’s language setting changes the Culture (locale) of their session in Web Screens

Pain Points

  1. Different languages between the SQL Server database and the application server’s system locale:
    • For the French and Spanish languages, since they are a Latin language like English, using any of these languages with a Latin database collation successfully performs any character conversion and is therefore supported
    • For the Chinese languages, the character conversion fails, resulting in displays of question marks (“?”) and is therefore not supported

2. Different languages between the Sage 300 user’s language (locale) and the application server’s system locale:

    • For French and Spanish, since they are a Latin language like English, using any of these languages successfully performs any character conversion and is therefore supported
    • For the Chinese languages
      • Desktop (for comparison only)
        • When a Chinese user and a Chinese locale is used, the Desktop sets the thread locale to use system locale so that all the subsequent data conversion between multibyte and wide characters will use the system locale where any character conversion is successful and is therefore supported. For example:

Blog191

        • When an English user and a Chinese locale is used, the Desktop sets the thread locale to use the system locale where any character conversion is successful and is therefore supported. For example:

Blog192

        • When a Chinese user and an English locale is used, the Desktop sets the thread locale to use the system locale and any character conversion is unsuccessful and is therefore not supported. For example:

Blog193.png

      • Web Screens
        • When a Chinese user and a Chinese locale is used, the Web Screens set the thread culture to use the user language so that any subsequent character conversions between multibyte and wide characters will use the ​user locale where the character conversion is successful and is therefore supported. For example:

Blog194

        • When an English user and a Chinese locale is used, the Web Screens set the thread culture to use the user language and any character conversion is unsuccessful and is therefore not supported. For example:

Blog195

        • When a Chinese user and an English locale is used, the ​Web Screens set the thread culture to use the user language where the characters are then passed to the view where it sets the thread locale to the system locale where the character conversion is unsuccessful and is therefore not supported. For example:

Blog196.png

3. Non-English characters in key or coded fields:

    • For the French and Spanish languages, since they are a Latin language like English, using any of these languages successfully performs any character conversion and is therefore supported
    • For the Chinese languages
      • Desktop (for comparison only)
        • In most screens when a user’s locale matches their system locale any character conversion is successful and is therefore supported.
      • Web Screens
        • Prior to the 2020 release, a regular expression statement was being used on certain fields to restrict characters based upon alphanumeric values “[A-Za-z0-9]”. However, this regular expression only allowed input of Latin-based alphanumeric characters.
        • In the 2020 release, a new regular expression was implemented which allowed alphanumeric values within the user’s locale to be considered acceptable.
          • However, certain underlying business views implemented their own restrictions which disallowed these newly acceptable characters. Thus, while these characters were now allowed to be entered, they were disallowed at the business view and/or database layer.
            • For example, key fields using the “N” mask in the Desktop, French and Spanish users can enter and save French and Spanish accents with an English locale, but Chinese users can enter, but cannot save even in a Chinese locale server and database. The table below sums up the comparisons between the Desktop and the Web Screens using AP Vendors and AP Vendor Groups:

Blog197.png

Summary

While Sage 300 supports English, French, Spanish, Traditional Chinese, and Simplified Chinese languages, customers using non-English languages in the Web Screens may encounter pain points especially when the user language and locale settings do not match.

However, for French and Spanish languages since they are Latin-based can enter and save characters without restriction.

This article attempts to illustrate Sage 300’s support for Unicode characters in the Sage 300 Web Screens.

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

 

 

Sage 300 How to Debug into a Business View from a Sage 300 Web Screen

Introduction

Some developers may already know how to debug into your C/C++ Accpac Business View while debugging/running your module’s Sage 300 Web Screen. But, for those who do not, this little tip is very handy.

This tip allows you to debug into your Accpac Business View (where you have the source) and from your module’s Sage 300 Web Screen.

Debugging in the IDE

You have your solution loaded in the Visual Studio IDE and when you debug, you want to debug all the way down into your C/C++ Accpac Business View.

In your solution, right-click on the Web project and select the Properties menu option:

Blog181

Click on the Web tab page and notice the Native Code checkbox at the bottom in the Debuggers section:

Blog182.png

Select this checkbox and Save the changes.

This will allow you to debug into your native C/C++ code.

Debugging in IIS

The previous section showed how you can debug into native code while debugging your web screen. But, what if you want to debug into native code while your screen is not running in debug (meaning it is running in IIS)?

Launch Visual Studio and be sure to Run as administrator

From the Debug menu, Select Attach to Process…:

Blog183.png

In the Attach to Process popup, be sure to Select the show processes from all users checkbox. Look for the w3wp.exe and Click on it.

There may be multiple w3wp.exe’s listed and it is important to select the correct one. If the user is listed as IIS APPPOOL\…, this is NOT the correct one as it is an IIS executable not running Sage 300.

Blog184

Once the correct w3wp.exe is highlighted, Click on the Select button:

Blog185.png

In the Select Code Type popup, Select the Debug these code types: option and Select the Managed (v4.6, v4.5, v4.0) and Native checkboxes and Select the OK button:

Blog186

This will allow you to debug into your native C/C++ code. 

Summary

This article explained how to debug into native C/C++ code when debugging your Web Screen solution in Visual Studio and also how to attach to an IIS process to debug into native C/C++ code if the Web Screen is running (not in debug mode).

Happy debugging.

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

 

Sage 300 How to Create a Class in Visual Studio from JSON

Introduction

Some developers may already know how to create a class from JSON metadata. But, for those who do not, this little tip is very handy.

I’ll use the Sage 300 Web API and create classes based upon the ARCustomers endpoint. Of course, this also possible with any JSON metadata, but since this is a Sage 300 blog, using Sage 300 metadata feels right.

I give credit for this tip to Vega and I’m simply providing an illustrated example in this article. Thanks Vega!

Sage 300 Web API

The Sage 300 Web API is a great source for JSON metadata since the payloads are JSON. And, since the Web API has implemented the Swagger UI, it is even easier to access the metadata.

The first step is to access the Swagger UI. This is accomplished by navigating to your Sage 300 Web API and accessing the Open Swagger UI button:

Blog161

After the Swagger UI has loaded the endpoints, scroll down to the ARCustomers endpoint and click on it to expand the available actions:

Blog162

Click on the first GET action to expand the UI. In the Model Schema section, you will see the metadata for the ARCustomers payload. Copy this entire section:

Blog163.png

Now, we have the JSON metadata in our buffer. It is time to move onto Visual Studio to create some C# classes based upon this metadata!

Visual Studio

In this example, I will be using Visual Studio 2017 and C#.

Open Visual Studio 2017 and Create a new class called ARCustomers:

Blog164

Before we paste the contents of the buffer, delete the 3 lines for the ARCustomers class, which are indicated by the arrow in the image above:

Blog165

We are now ready to paste our JSON. From the Edit menu, select Paste Special –> Paste JSON As Classes:

Blog166

That’s it! Well, almost. 😊 As you can see, we now have C# classes that follow the hierarchy of the JSON metadata. It is very easy to see the hierarchy as well as all the column names:

Blog167

The Paste Special feature names the top class Rootobject and the first or main class is named value. It makes more sense that they are named ARCustomers and ARCustomer respectively:

Blog168.png

Tip

The arrays should be changed to IList especially when dealing with optional fields.

Summary

This article explained how to create C# classes in Visual Studio 2017 from JSON metadata that was copied from the Sage 300 Web API ARCustomers endpoint.

Any copied JSON metadata can use the Paste Special feature in Visual Studio to create classes based upon the JSON. I used the Sage 300 Web API as an example of metadata that will create several classes based upon the JSON.

Thanks again Vega for the tip!

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

Sage 300 2019 Web SDK

Introduction

The Sage 300 Web SDK (SDK) is a collection of wizards, utilities, samples and documentation for developing Web Screens for the Sage 300 Application.

This week we released the Sage 300 2019 Web SDK to coincide with the release of the Sage 300 2019 Application.

It’s Available!

The SDK is available at https://github.com/SageNADev/Sage300-SDK.

Branches

As described in a previous blog and in the README file in the root of the repository, the branches contain the different versions of the SDK.

master

Contains the current version of the SDK (2019).

develop

Contains the in-progress version of the SDK (2019.1).

release-…

Contains the previous versions of the SDK (release-2017, release-2017.1, release-2017.2, release-2018, release-2018.1, and release-2018.2)

What’s New

Documentation

Updated documentation is available.

In the docs\upgrades folder is a document for the upgrade procedures for moving partner source from Sage 300 2018.2 to Sage 300 2019. There is a manual step in the upgrade process, so please familiarize yourself with the upgrade steps.

In the docs\development folder you will find a new document for partners wishing to add metadata for the Global Search feature.

The docs\presentations folder has been updated and includes a PowerPoint presentation for what’s new in the SDK for 2019.

In the docs\utilities folder the document for the MergeISVProject utility has been enhanced to include the changes for the new ExternalContent folder.

The DPP wiki has two new articles:

  • KB: 91472 (Using Visual Studio 2017 with the Sage 200 2019 SDK (desktop))
    • This covers issues and information discovered wen Sage moved to Visual Studio 2017 to compile the application and Business Views
  • KB: 91473 (Writing SDK (desktop) applications that do not require “Run As Administrator”)
    • This covers the issue and resolution discovered requiring Sage 300 to be Run As Administrator.

Visual Studio 2017

All wizard manifests have been revised to ONLY include Visual Studio 2017 as a target IDE.

Blog171

Visual Studio 2013 and Visual Studio 2015 are no longer supported targets.

Version Change

The Accpac.Advantage and Accpac.Advantage.Types versions are now 6.6.0.0 and all the AccpacDotNetVersion.props files for the source and samples have been updated.

Blog172.png

Going forward, any changes to the version number will be made in all 5 core libraries. 2018.2 introduced a flaw where a matrix was required to know which version of which library was compatible with another. Thus, by keeping all the libraries at the same version, a compatibility matrix will not be required!

Samples

The samples have been updated with new global references and no longer require the kendo.all.min.js file to be added to each sample prior to compiling.

The web project in all samples has been renamed to include the module in the name and namespace (ValuedParter.TU.Web) to accurately reflect the name of the web project being generated by the solution wizard.

A defect was corrected in the receipt sample regarding Optional Fields. The property ‘YesNoValue’ was renamed to ‘YesOrNoValue” as the Optional Fields framework expects this name.

Solution Wizard

Sage 300 2018.1 introduced vertical menus for navigation. However, the hardcoded images for partner menus were based upon the position of the partner menu (12 hardcoded images for 12 partner menus). It was not ideal, but all the time we had in 2018.1!

Sage 300 2018.2 removed the hardcoded images and replaced them with default images that maybe overridden by the partner who wishes to supply their own images.

However, this implementation was inefficient and not robust to provide the needed framework for third-party images and other files as well.

Sage 300 2019 introduces the ‘ExternalContent’ folder. This folder exists in the Areas\{module} folder and is the location for the 2 required images for partners and is now the location for any user created folders and content files (i.e. images, JavaScript, etc.) that may need to be delivered with the partner module. The previous implementation had limitations if a partner has multiple modules as well as not providing a place for other files and folders.

2018.2 location: ..\Online\Web\External\Images\nav\{companyname}

2019 location: ..\Online\Web\Areas\{module}\ExternalContent

As you can see, the new location in the Sage 300 installation allows for multiple modules per partner and content not specific or related to images or navigation

The 2 required images, menuBackGroundImage.jpg and menuIcon.png, have been renamed to:

  • bg_menu_{module}.jpg
  • icon_{module}.png respectively

These names follow the naming convention of these images used by Sage 300 for our modules. The Upgrade Wizard will rename these images to the new names.

The {module}MenuDetails.XML files will reference the new location of these files:

2018.2 reference:

<IconName>{companyname}/menuIcon.png</IconName>   <MenuBackGoundImage>{companyname}/menuBackGroundImage.jpg</MenuBackGoundImage>

2019 reference:

<IconName>

../../../../Areas/{module}/ExternalContent/icon_{module}.png

</IconName>

<MenuBackGoundImage>

../../../../Areas/{module}/ExternalContent/bg_menu_{module}.jpg

</MenuBackGoundImage>

References to global files were updated and the Crystal Reports components now reference 13.0.3500.0 instead of 13.0.2000.0

An issue was discovered when attempting to debug a report in Visual Studio. There is a requirement where the ‘aspnet_client’ folder and its contents must exist for the solution. The solution wizard will now create this folder and its contents.

Customization Wizards

References to global files were updated.

The Default Compatibility level was changed from 6.5A+ to 6.6A+.

This property is informational only.

Code Generation Wizard

References to global files were updated.

Several defects were addressed this release:

  • Invalid Character in Property Name
    • Replaced ‘%’ if discovered
  • Duplicate Property Name Message
    • Added property name to message for invalid, blank or duplicate field names
  • The ValidRecordFilter Property in Business repository
    • When a zero value or other irregular value is legitimate, this filter may prevent proper CRUD. The filter is still generated by wizard, but is commented out and a TODO statement is generated:

Blog173.png

  • Duplicate Entries in Web Bootstrapper Class
    • Invalid logic was corrected
  • Enumerations in View Model Need Type
    • Enumerations in the web’s ViewModel are used to bind to controls such as the drop-down list. However, the IEnumerable must have a type of CustomSelectList. The wizard now generates the correct code:

Blog174.png

Existing partner code will not be modified as it would have to have been modified for it to work and thus already have been modified

Upgrade Wizard

References to global files were updated and the Crystal Reports components now reference 13.0.3500.0 instead of 13.0.2000.0

The web project will be modified to add the ExternalContent folder (see Solution Wizard section).

The ‘aspnet_client’ folder and its contents will need to be added to the web project if it is not already present and the web project contains reports that wish to be debugged in Visual Studio. See the Upgrade document for manual instructions for locating, copying and adding this folder to the web project.

The MergeISVProject.exe will be updated to reflect a change dealing with Minify JavaScript changes (see MergeISVProject Executable section).

Inquiry Configuration Wizard

This is a new wizard that was to be introduced in 2019, but will be delayed until 2019.1

This is the wizard which will create the metadata required to add or modify scripts used to drive the generic and adhoc inquiry displays.

MergeISVProject Executable

This utility is a post-build utility used by various wizards and the generated partner solution to pre-compile Razor Views and deploy assets to a local Sage 300 installation for developer testing.

An issue was discovered where it did not properly deal with sub-folders. This has been addressed.

Process Unit of Work Enhancement

In previous releases, a base class routine was required to be overridden if a return value or values was needed from a process task (Business View).

Changes in this release have made it easier to return values without overriding a base class routine and instead a base class property is simply overridden. This is explained in detail is the following article: https://jthomas903.wordpress.com/2018/08/21/sage-300-how-to-return-super-view-values-from-the-process-service/

Summary

The Sage 300 2019 SDK is released and ready to be downloaded!

Documentation updates, KB articles, the ability to run the wizards ONLY in Visual Studio 2017, updates and corrections to samples, a new ExternalContent folder, synchronization of global files and references in the wizards, and the ability to easily return values from a process task are in the Web SDK.

Functionality, documentation, tutorials, enhancements, etc. that are not currently in the SDK which should be there to better assist with efficient development practices and time-to-market considerations, please contact the Sage 300 Product Manager. The partners voice and feedback resound the loudest!

We continue to look forward to addressing the needs and expectations of the Sage partner community and ecosystem.

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

Sage 300 Trouble Installing Visual Basic 6.0 on Windows Server 2012/2016

Introduction

The Sage 300 SDK, not Web SDK, requires Visual Basic 6.0 SP6 to be installed on the computer. But, what happens when that computer has Windows Server 2012/2016 and there are compatibility issues when attempting to install Visual Basic 6.0?

This article will show how to get Visual Basic 6.0 successfully installed.

Solution

While this solution might not work for all, it has worked for Sage 300 developers.

Simply uncheck the Data Access Components option during the installation:

Blog151

That’s it!

References

If more information is required or if the actual steps needed to install Visual Basic 6.0 on Windows Server 2012/2016 (and even Windows 10) are required, please refer to the following links:

https://stackoverflow.com/questions/30656303/vb-6-data-access-component-installation-on-windows-2012-server

http://donovanbrown.com/post/Build-Visual-Basic-60-applications-with-Visual-Studio-Team-Services

https://www.codeproject.com/Articles/1191047/Install-Visual-Studio-on-Windows

Summary

This article explained how to install Visual Basic 6.0 on Windows Server 2012/2016 by unchecking the Data Access Components option.

Reference links are provided if more information is required.

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.

Sage 300 How to Return Super View Values from the Process Service

Introduction

So, you are developing Web Screens for Sage 300 and you want to be able to check a field value or some field values that are returned from the super view. In the Sage 300 Desktop, which is based upon the Visual Basic 6.0 development environment, this is simple and straight-forward.

But, how is this done in the Web Screens where the process is handled by a Worker Role?

This article will explain how this is accomplished by looking at our Sage 300 Web Screen Payment Batch Unit of Work (UOW) service implementation as an example.

Process Flow

But, before we begin, let’s briefly review the Web and Worker Roles as they relate to a Process task.

Blog141

The Sage 300 Web Architecture uses both web and worker roles to serve the functionality of the web screens. Worker roles are used for most long running processes, usually indicated by a progress-meter, and some reports.

Blog142

The above diagram illustrates the flow once a process screen submits or starts the process.

Because the super view is handled and processed in the worker role, the business view (which is mapped to an MVC model) is not returned to the web role to access the required values.

Process UOW Service

Blog143.png

The Process UOW Service is the class that invokes the Process Repository where the super view’s Process function is invoked and hydrates a model upon return from the function.

var model = repository.Process(seedEntity.Model);

But, this model is in the worker role and the model is not serialized back to the web role.

Process Result’s ResultObject

The ResultObject in the ProcessResult object will contain the value or values that you will want to return to the web role. But, you must place what you want in this object since we do not serialize the model into this object (hindsight says we should have!).

Prior to Sage 300 2019, the setting of the ResultObject was done by the developer by overriding the Process UOW’s OnExecute base class method. The following routine is from our 2018.2 implementation of the Payment Batch UOW class:

Blog144

While overriding this base class method effectively was able to access and set the ResultObject, it also needlessly had to implement a lot of other code.

Sage 300 2019 eliminated the need to override the OnExecute base class method by providing an override method which provides the ability to set the ResultObject without re-implementing the base class method. The overridden OnExecute was deleted in the Payment Batch UOW class and replaced with an override to the GetResultObject method instead:

Blog145

Back in the Web Role

At the completion of the process, control is returned to the screen’s JavaScript callback function onProcessComplete. If the ResultObject was set in the Process UOW Service’s override method GetResultObject, it is now available in this callback event:

Blog146.png

Summary

This article explained how to return a super view value or values from a process service in the Sage 300 Web Screens.

As indicated in the XML Comments for the GetResultObject virtual method, since this is a single object and not an array or dictionary, if multiple values are required, use the pipe symbol as separator to concatenate multiple fields.

The GetResultObject is a virtual method that can be overridden in the Process UOW service class to return a value or values from the worker role to the web role.

The onProcessComplete JavaScript callback function is invoked at the completion of the process and the ProcessResult.ResultObject is available for the developer with any values that may have been set in the worker role. By default, the ResultObject is null.

So, not as simple as the desktop implementation, but still doable with a few extra steps!

As a standard disclaimer, any topic in this article is subject to review and doesn’t represent a commitment as to when it will be available.