Enjoy these free Code Nuggets?

Your support helps us create more high-quality content and unlocks exclusive premium nuggets via a personal activation link.

Support Our Work & Get Exclusive Access
🤖 New — AI Training

Learn to code with AI, not just about it.

Beyond free snippets, we run hands-on training in AI-assisted coding — teaching developers, teams and beginners how to build real software faster using modern AI tools. You bring the ideas; we show you how to ship them with an AI pair-programmer at your side.

  • ✔ Prompting & pairing with AI coding assistants to write, debug and refactor real code
  • ✔ Turning plain-English ideas into working apps, scripts and automations
  • ✔ Reviewing AI output safely — spotting bugs, security gaps and hallucinations
  • ✔ Live cohorts, team workshops and 1-on-1 mentoring — remote or on-site in Kenya
ai-pair-session.md

# You describe it…

"Build me a booking form that emails the client."

# …the AI drafts it…

▸ generating form + mailer…

â–¸ 24 lines written, 0 errors

# …and we teach you to lead it.

✱ You stay the engineer. AI is the tool.

Business Central (AL) nuggets

4 nuggets found

Clear filter

Dynamics 365 Business Central: AL Language M-Pesa Invoice Sync (Premium)

Business Central AL Extension connecting customer general ledger accounts with automated M-Pesa STK Push payment reconciliations and invoice posting.

// Business Central AL M-Pesa Invoice Reconciliation Codeunit
codeunit 50100 "MPesa Payment Handler"
{
    trigger OnRun()
    begin
    end;

    procedure ProcessMPesaCallback(DocNo: Code[20]; AmountPaid: Decimal; TransCode: Code[30])
    var
        CustLedgerEntry: Record "Cust. Ledger Entry";...

Extending a Standard Table with a Table Extension (Premium)

In Business Central you never modify base tables — you extend them. A tableextension adds your own fields to a standard table so upgrades stay clean and your data lives...

tableextension 50100 "Customer Ext" extends Customer
{
    fields
    {
        field(50100; "Loyalty Points"; Integer)
        {
            Caption = 'Loyalty Points';
            MinValue = 0;
            DataClassification = CustomerContent;
        }
        field(50101; "Preferred Channel"; Op...

Surfacing New Fields with a Page Extension (Premium)

Adding a field to a table does not show it to users. A pageextension places your new fields onto the standard card or list page, anchored next to existing controls.

pageextension 50100 "Customer Card Ext" extends "Customer Card"
{
    layout
    {
        addlast(General)
        {
            field("Loyalty Points"; Rec."Loyalty Points")
            {
                ApplicationArea = All;
                ToolTip = 'Points earned by this customer.';...

Hooking Business Logic with AL Event Subscribers (Premium)

Event subscribers are how you react to platform actions without touching base code. Subscribe to a published event — like validating a field — and run your own logic when...

codeunit 50100 "Loyalty Events"
{
    [EventSubscriber(ObjectType::Table, Database::"Sales Header",
        'OnAfterValidateEvent', 'Sell-to Customer No.', true, true)]
    local procedure OnValidateCustomer(var Rec: Record "Sales Header")
    var
        Cust: Record Customer;
    begin
        if...