Case Study: Product Stock Management Tool

Summary

In order to demonstrate an end-to-end solution build where Linx plays a vital role, a small project was completed and will be explained below. The project serves as a Product Stock management tool which allows the user to export his products in the correct CSV format to allow upload into the Bidorbuy.co.za sales portal (much like eBay). This project assumes the user has registered as a Seller on Bidorbuy. All shipping and payment setups need to be completed on Bidorbuy itself.
The full solution which can be customized to your own situation can be downloaded from Github here.

Overview

Selling items on Bidorbuy.co.za is rather easy to do, but can quickly become an time-consuming process as each sale item expires after a while, and to keep reposting 20+ items is a tedious task. Bidorbuy has provided a Bulk import function, supporting CSV files, but these are also not really user-friendly, as the format of the files are extremely specific.

In order to make life easier, a solution was designed and built to manage the whole process of loading products, adding stock and generating a CSV to upload into Bidorbuy.
In order to facilitate the process, different components were used:

The high-level design was done, the PowerPoint presentation is in GitHub as well.

Database

A very simple database was designed and built to underpin the solution. The SQL script to create the Database is in GitHub.

Frontend (Stadium)

In order to not code anything, Stadium was used as a Frontend for the solution. The overall Structure is:

The Stadium solution file is also in the GitHub repository. All the queries are in there. Just remember to set your own Connection String.

To get a nice view of the Product Status, I’ve made a Dashboard as the first screen. Can add more here:

To launch the Generating of the file, you need to go to the Generate screen:

After pressing the Generate New File button, the Generate New File Screen will show, where you can select your parameters for this file. Once complete, you can click the OK button.

Finally the Linx process is called. To connect to Linx from Stadium, use the “Call Web Service” Action, and use the URL from the Linx Server. The Query linking was done as follows:

Processing (Linx):

Now in Linx itself, a new Project was created, with a single Process. The Process was called “GenerateFile”.

The structure of the “GenerateFile” Process is (Note these two images are sequential of the same process):

In general the process:

  • Gets default values from the DB or Inputs
  • Reads the Template file from Bidorbuy, as we need the first, header line of that file in our own file as well.
  • Opens a new file, where we first add the header line, then we load each active product and safe all its info into a single “ProductLine”, which gets added to our file.
  • We save the File location and details to the DB so we can get it on our grid in Stadium.

Where we create the Product’s information, the Code in Expression Editor does become intense, that’s why they were split up into each heading. Here’s the extract of the Listing Description:

Settings EVERYWHERE

I wanted to save all the settings in one location, but as it was starting to take a lot of time to keep changing the strings where they break the system due to special characters, I ended up with 3 locations for settings.

  • In Linx’s Project Settings
  • In the Database Settings Table
  • Stadium has its own Connection String setting

A future fix would be to get all these settings in one place, the Database, so we can change all from the frontend:

Notes:

  • I’ve only implemented the “Buy Now” sales function, and not the “Auctions”.