Reading XML into Business Central with Base64 strings (pictures)

I recently had assignment where I had XML file with ID’s and Base64 images and I had to import it against Business Central Records. I thought it will take like an hour and I be done with it but it was more complicated then I thought. So I thought I might share my solution if anybody needs to do the same. The solution uses XmlPort and imports base64 as bigtext. Then its converted to blob and streamed into the employee....

April 7, 2021 · Villem Heinsalu

How to add automatic CC for emails sent out from Business Central via SMTP

Here’s a small snippet on how add automatic CC for all outgoing emails from Business Central via SMTP. This methods also works when you want to change To or Bcc or even email subject or body. This code example below checks if user has email setup and if it has then uses that email to add as CC for all outgoing emails. [EventSubscriber(ObjectType::Codeunit, Codeunit::"Mail Management", 'OnBeforeSentViaSMTP', '', false, false)] local procedure AddCCToEmail(var SMTPMail: Codeunit "SMTP Mail") var UserSetup: Record "User Setup"; SendToCcList: List of [Text]; begin if UserSetup....

April 1, 2021 · Villem Heinsalu

Example of building portal site for Business Central using Blazor

Hello. I spent little time to put together Business Central and Blazor Server App. Feel free to use it if you find it useful. This is just a example of how these two technologies work together and is production ready completed application. How it works: Business Central publishes custom Odata API Blazor is using connected service to discover this Odata API All models and services for the Odata API are created automatically Blazor Server application is just a thin client getting data and posting data to the Odata API Blazor application doesn’t have its own DB at the moment and its not needed for this to work Currently the app allows to list all Assembly orders, create new item tracking for Lots in Business Central for the assembly orders, post quantities etc....

February 8, 2021 · Villem Heinsalu

How to use forked package in golang

I recently had to fork one of the packages that I was using in my golang project and it wasn’t so straight forward as you might think. So heres the steps to make it work: Fork the package Make your changes and push them run go mod edit -replace github.com/original/gopackage=github.com/you/go-git@branch for my example I had issues with package github.com/google/go-github So first I forked the project and then did my changes....

December 14, 2020 · Villem Heinsalu

Showcase: A web app to create Request For Quotations For Quickbooks users

I had booked a trip to Portugal for two weeks in beginning of April 2020 but then corona came and the trip was cancelled. I still had the vacation from my main job and I didn’t want to cancel the it. Since everything was in lockdown I used that time to build gosourcingwise - a web application that allows businesses to ask Quotations from their vendors. It is meant for companies already using Quickbooks accounting software....

August 18, 2020 · Villem Heinsalu

Get data out from Business Central via Odata API

Singer.io is Open Source standard to move data between services and targets. Service can be what ever Saas or on-Prem business software and target can be Google BigQuery, Redsift, Postgres or other data storage. The beauty of the singer tap’s is that once you create tap then you can use it with what ever target you want. I’ve create tap that pulls data out from Microsoft Business Central ERP via Odata API’s....

August 17, 2020 · Villem Heinsalu

Lessons learned

This is just a collection of random thoughts that I want myself to remember about software development All if and else if’s need default case else. When doing some checks on data there should always be default case for something thats not handled and either throw error or log it as error or unhandled case. This is where bugs hide. Always reset variables assigned to this in class When using classes always reset variables that are assigned to this context in class....

July 4, 2020 · Villem Heinsalu

How to publish Dotnet Core Blazor Web Assembly App to Digitalocean using Github Actions

I struggled with building this pipeline a bit so I thought I would share the process 1. Create Blazor APP and Digitalocean droplet I created new Blazor Web Assembly project in Visual studio using the Dotnet Core hosted model. In Digitalocean I used the smallest and cheapest $5 Ubuntu 18 droplet and set up Nginx manualy. 2. Create Github Actions Template to your Blazor project name: .NET Core on: push: branches: [ master ] jobs: build: runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Setup ....

May 7, 2020 · Villem Heinsalu

Working with Javascript Objects without mutating them

When working with Javascript then very often you will have the need to pass object into a method, so some processing with it, i.e add new fields or change existing fields and then return the object. Doing this is not very safe or clean since in Javascript objects are passed by reference and it means that you can manipulate object state and cause some strange things to happen. Recently my collegue introduced to me more cleaner and functional way to do this....

February 20, 2020 · Villem Heinsalu

Load some data to ERPNext to analyze it in Metabase BI

In previous post I installed ERPNext and Metabase on Digitalocean. Now I’m going to load some data into ERPNext and Connect it to Metabase so display the data. I’m not going to use ERPNext data loading tools but do it via API usin Go programming language. I will be creating 1000 Sales orders and customers in ERPNext using API calls. It will also test how well the 5$ Digital Ocean droplet will hold when giving it some work to do....

February 1, 2020 · Villem Heinsalu