<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>Forem: Yahya Touil</title>
    <description>The latest articles on Forem by Yahya Touil (@yahyatouil).</description>
    <link>https://forem.com/yahyatouil</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F3808581%2F1133b606-9bd7-45da-ab42-db01de995132.jpg</url>
      <title>Forem: Yahya Touil</title>
      <link>https://forem.com/yahyatouil</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/yahyatouil"/>
    <language>en</language>
    <item>
      <title>How I applied SOLID principles and Interface patterns in AL to build an AppSource-ready BC extension</title>
      <dc:creator>Yahya Touil</dc:creator>
      <pubDate>Thu, 05 Mar 2026 20:33:17 +0000</pubDate>
      <link>https://forem.com/yahyatouil/how-i-applied-solid-principles-and-interface-patterns-in-al-to-build-an-appsource-ready-bc-extension-9ep</link>
      <guid>https://forem.com/yahyatouil/how-i-applied-solid-principles-and-interface-patterns-in-al-to-build-an-appsource-ready-bc-extension-9ep</guid>
      <description>&lt;p&gt;Most AL developers have written this at least once:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alcase Strategy of
    Standard: Score := CalculateStandard(...);
    Weighted: Score := CalculateWeighted(...);
end;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;It works. Until a third strategy. Then a fourth. Then a partner wants their own.&lt;/p&gt;

&lt;p&gt;Every addition means opening production code, touching the calculator, risking a regression, redeploying.&lt;/p&gt;

&lt;p&gt;The Cash Flow Risk Engine, a BC extension that scores customers 0–100 on payment behavior and generates risk-adjusted 30/60/90-day forecasts, was built to never have this problem. Here's the core pattern:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;Interface + Enum = permanently closed calculator&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;alinterface ICFR_RiskStrategy
{
    procedure CalculateScore(...): Decimal;
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Each algorithm implements the interface independently. The enum binds each value to its codeunit via AL's Implementation keyword. The calculator becomes:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;alStrategy := CFRSetup."Default Risk Strategy";&lt;/p&gt;

&lt;p&gt;Score    := Strategy.CalculateScore(...);&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;It never mentions a specific codeunit by name. A partner ships a new ML-based strategy as their own extension, zero changes to core code.&lt;/p&gt;

&lt;p&gt;Other patterns worth knowing about in this project:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;SetLoadFields on every Cust. Ledger Entry read, critical on 1M+ row tables&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Query objects instead of table loops for aggregation (compiles to SQL GROUP BY)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Use temporary tables and single bulk writes; avoid commits inside processing loops.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Implement per-record error isolation so that one corrupted entry doesn’t abort an entire batch (e.g., 8,000 customers).&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Maintain a telemetry facade with one codeunit, ensuring consistent custom dimensions and respect for the enable/disable flag.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Treat AppSource compliance as a design constraint from day one, not merely a submission checklist.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;The probability model is interesting too, every expected amount is discounted by a collection probability derived from the risk score, so the CFO sees the realistic number alongside the raw one.&lt;/p&gt;

&lt;p&gt;Full architecture breakdown with every design decision on my blog 👉 &lt;a href="https://yahyatouil.com/posts/building-enterprise-cash-flow-risk-engine-business-central-al/" rel="noopener noreferrer"&gt;blog link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Source code 👉 &lt;a href="https://github.com/yahyatouil-dev/bc-cashflow-forecasting-risk-engine" rel="noopener noreferrer"&gt;https://github.com/yahyatouil-dev/bc-cashflow-forecasting-risk-engine&lt;/a&gt;&lt;/p&gt;

</description>
      <category>businesscentral</category>
      <category>solidprinciples</category>
      <category>development</category>
      <category>programming</category>
    </item>
    <item>
      <title>I built 7 VS Code tools for Business Central developers because the workflow pain was real</title>
      <dc:creator>Yahya Touil</dc:creator>
      <pubDate>Thu, 05 Mar 2026 20:26:32 +0000</pubDate>
      <link>https://forem.com/yahyatouil/i-built-7-vs-code-tools-for-business-central-developers-because-the-workflow-pain-was-real-4cgn</link>
      <guid>https://forem.com/yahyatouil/i-built-7-vs-code-tools-for-business-central-developers-because-the-workflow-pain-was-real-4cgn</guid>
      <description>&lt;blockquote&gt;
&lt;p&gt;Field 19 of 43. Typed by hand. From a JSON response.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;That was the moment I stopped accepting the workflow and started building something better.&lt;/p&gt;

&lt;p&gt;Business Central development carries a lot of invisible overhead, and none of it is the hard part. It's the boilerplate, the folder setup, the JSON-to-AL mapping, the constant Postman context switching. Mechanical work that consumes focus without earning it.&lt;/p&gt;

&lt;p&gt;I spent six months building BC HERO: a free VS Code extension with seven tools that eliminate the most painful parts of the AL development workflow.&lt;/p&gt;

&lt;p&gt;What's inside:&lt;/p&gt;

&lt;p&gt;🗂️ Quick Project Setup — select your AL component folders, preview the structure, generate in one click. No more five-minute directory rituals.&lt;/p&gt;

&lt;p&gt;🧱 AL Object Creator — all 16 AL object types, guided form, auto-calculated next available ID, batch queue. Generate everything in one pass.&lt;/p&gt;

&lt;p&gt;⚡ JSON → AL Generator — drop a JSON file (plain objects, arrays, OData { "value": [...] } all work). BC HERO infers AL types, lets you customise, outputs syntax-highlighted AL. 30 fields in about 3 minutes instead of 25.&lt;/p&gt;

&lt;p&gt;🔌 API Explorer — full HTTP client inside VS Code. Scans your workspace for API pages and queries. Basic Auth and OAuth 2.0. I haven't opened Postman for a BC project since I built this.&lt;/p&gt;

&lt;p&gt;🌍 Translation Assistant — visual XLIFF editor with progress bars, inline editing, validation, and batch updates. A 200-unit review cycle went from over an hour to under 20 minutes.&lt;/p&gt;

&lt;p&gt;📊 Schema Viewer — interactive force-directed graph of your table relationships with field metadata sidebar. First thing I open in an unfamiliar codebase.&lt;/p&gt;

&lt;p&gt;🔗 Dependency Graph — visualization of every object in your workspace, color-coded by type, with directed dependency edges.&lt;br&gt;
It's free and always will be.&lt;/p&gt;

&lt;p&gt;Full story and design rationale on my blog 👉 &lt;a href="https://yahyatouil.com/posts/bchero-vs-code-extension-business-central-dev/" rel="noopener noreferrer"&gt;blog link&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;VS Code Marketplace 👉 &lt;a href="https://marketplace.visualstudio.com/items?itemName=yahyatouil.bc-hero" rel="noopener noreferrer"&gt;https://marketplace.visualstudio.com/items?itemName=yahyatouil.bc-hero&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;GitHub (issues, roadmap) 👉 &lt;a href="https://github.com/yahyatouil-dev/bc-hero-info" rel="noopener noreferrer"&gt;https://github.com/yahyatouil-dev/bc-hero-info&lt;/a&gt;&lt;/p&gt;

</description>
      <category>webdev</category>
      <category>vscode</category>
      <category>productivity</category>
      <category>businesscentral</category>
    </item>
  </channel>
</rss>
