<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:media="http://search.yahoo.com/mrss/"><channel><title><![CDATA[Navigating 365]]></title><description><![CDATA[Software Engineering, Microsoft Dynamics, and the Cloud ☁️]]></description><link>https://navigating365.com/</link><image><url>https://navigating365.com/favicon.png</url><title>Navigating 365</title><link>https://navigating365.com/</link></image><generator>Ghost 3.2</generator><lastBuildDate>Wed, 04 Feb 2026 11:45:47 GMT</lastBuildDate><atom:link href="https://navigating365.com/rss/" rel="self" type="application/rss+xml"/><ttl>60</ttl><item><title><![CDATA[[Visual Studio] Azure Functions Configuration is missing the 'HostEndpoint' information.]]></title><description><![CDATA[[Azure Functions] Configuration is missing the 'HostEndpoint' information. Please ensure an entry with the key 'Functions:Worker:HostEndpoint' is present in your configuration.]]></description><link>https://navigating365.com/azure-functions-configuration-is-missing-the-hostendpoint-information-please-ensure-an-entry-with-the-key-functions-worker-hostendpoint-is-present-in-your-configuration/</link><guid isPermaLink="false">67b46913dc74cb04a2f5207d</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Tue, 18 Feb 2025 11:08:16 GMT</pubDate><content:encoded><![CDATA[<figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2025/02/image.png" class="kg-image"></figure><p>[Azure Functions] Configuration is missing the 'HostEndpoint' information. Please ensure an entry with the key 'Functions:Worker:HostEndpoint' is present in your configuration.</p><p>I solved this by updating Visual Studio Azure Development Toolkit:</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2025/02/image-1.png" class="kg-image"><figcaption>Ensure you have Azure development ticked</figcaption></figure><p>If you'd like to run from VS Code, ensure that you have Core tools installed:</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://learn.microsoft.com/en-us/azure/azure-functions/functions-run-local"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Develop Azure Functions locally using Core Tools</div><div class="kg-bookmark-description">Learn how to code and test Azure Functions from the command prompt or terminal on your local computer before you deploy them to run them on Azure Functions.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://learn.microsoft.com/favicon.ico"><span class="kg-bookmark-author">ggailey777</span><span class="kg-bookmark-publisher">Microsoft Learn</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://learn.microsoft.com/en-us/media/open-graph-image.png"></div></a></figure><p></p><p> If you are running from Visual Studio, you don't need to directly install Core tools. </p>]]></content:encoded></item><item><title><![CDATA[Business Central Legends!]]></title><description><![CDATA[Scene 1: Introduction
Functional Force (panicked): Guys! The client wants automatic approval workflows for Purchase Orders based on amounts, but ALSO needs custom email notification...
 ]]></description><link>https://navigating365.com/business-central-legends/</link><guid isPermaLink="false">66e18ff5dc74cb04a2f5201e</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Wed, 11 Sep 2024 12:49:13 GMT</pubDate><media:content url="https://navigating365.com/content/images/2024/09/Team.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2024/09/Team.jpg" alt="Business Central Legends!"><p></p><p></p><!--kg-card-begin: html--><!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <meta http-equiv="X-UA-Compatible" content="ie=edge">
  <title>Business Central Legends</title>
   <style>
    /* Scoped CSS for the Business Central section */
    .business-central-section * {
      margin: 0;
      padding: 0;
      box-sizing: border-box;
    }

    .business-central-section {
      font-family: Arial, sans-serif;
      line-height: 1.6;
      background-color: #f4f4f4;
      color: #333;
      padding: 20px;
    }

    .business-central-section header {
      background-color: #0078d4;
      color: #fff;
      padding: 20px;
      text-align: center;
      border-radius: 8px;
    }

    .business-central-section h1 {
      margin-bottom: 10px;
    }

    .business-central-section h2 {
      font-size: 1.5em;
    }

    .business-central-section section {
      margin: 20px;
      padding: 20px;
      background-color: #fff;
      border-radius: 8px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    }

    .business-central-section .scene h3 {
      font-size: 1.2em;
      color: #0078d4;
      margin-bottom: 10px;
    }

    .business-central-section .scene p {
      margin-bottom: 10px;
      font-size: 1em;
    }

    .business-central-section strong {
      color: #0078d4;
    }

    .business-central-section footer {
      text-align: center;
      margin: 20px;
      padding: 20px;
      background-color: #fff;
      border-radius: 8px;
      box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
      font-style: italic;

  </style>
</head>
<body>
<div class="business-central-section">
  <header>
    <h1>Business Central Legends</h1>
    <h2>The Code Crafter, The AL Sorceress, and The Functional Force!</h2>
  </header>

  <section class="scene" id="scene1">
    <h3>Scene 1: Introduction</h3>
    <p><strong>Functional Force (panicked):</strong> Guys! The client wants automatic approval workflows for Purchase Orders based on amounts, but ALSO needs custom email notifications triggered when approvals are overdue! AND they want this to integrate with Teams!</p>
    <p>(Scroll smacks into Code Crafter’s face as it keeps unrolling.)</p>
    <p><strong>Code Crafter (muffled under the scroll):</strong> Please tell me this is the last change request.</p>
  </section>

  <section class="scene" id="scene2">
    <h3>Scene 2: Functional to the Rescue</h3>
    <p><strong>Functional Force (frazzled):</strong> I’m drowning in requirements here! The client keeps adding stuff—purchase approval limits, custom emails, Teams integration… are we deploying a rocket, or an ERP?!</p>
    <p><strong>AL Sorceress (calmly spinning her staff):</strong> Pfft. They want automatic approval flows for purchase orders based on amounts? Standard Business Central. No big deal.</p>
    <p>(She summons a glowing Purchase Order with conditional approval tiers floating above her head.)</p>

<!--kg-card-end: html--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2024/09/Untitled-design.jpg" class="kg-image" alt="Business Central Legends!"><figcaption>(She summons a glowing Purchase Order with conditional approval tiers floating above her head.)</figcaption></figure><!--kg-card-begin: html-->    <p><strong>Code Crafter (cracking knuckles):</strong> Email notifications and Teams integration? Piece of cake. I’ll link Power Automate to send custom reminders when approvals are overdue, and drop those into a Teams channel.</p>
  </section>

  <section class="scene" id="scene3">
    <h3>Scene 3: Enter Project Manager Pete</h3>
    <p><strong>Project Manager Pete (anxious):</strong> Hey team! Soooo the client just said they need this approval workflow yesterday, but we also have a bug in the sales orders module, and oh, can we fit in a few more fields on the Purchase Order page? Also, who stole my coffee?</p>
    <p><strong>Code Crafter (deadpan, gesturing to Pete’s coffee-stained shirt):</strong> Looks like the coffee stole you, Pete.</p>
    <p><strong>AL Sorceress (glaring at Pete):</strong> Is there a single day when you don’t come in here over-caffeinated with extra tasks?</p>
    <p><strong>Functional Force (sarcastic):</strong> Don’t worry, Pete. We’ll build a custom Power BI dashboard… for your stress.</p>
  </section>

  <section class="scene" id="scene4">
    <h3>Scene 4: The Functional Requirement</h3>
    <p><strong>Functional Force (explaining seriously):</strong> Okay, so here’s what the client wants: Purchase Orders over $5,000 need Manager Approval. Purchase Orders over $10,000 need Director Approval. If the approval doesn’t happen within 24 hours, send an email reminder AND notify the Finance Team in Teams. Oh, and they want a report showing all outstanding approvals at any given time.</p>
    <p>(She throws the scroll down like it’s a mic drop.)</p>
  </section>

  <!--kg-card-end: html--><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2024/09/Untitled-design--1-.jpg" class="kg-image" alt="Business Central Legends!"><figcaption>(She throws the scroll down like it’s a mic drop.)</figcaption></figure><!--kg-card-begin: html--><section class="scene" id="scene5">
    <h3>Scene 5: The Technical Solution</h3>
    <p><strong>Code Crafter (explaining):</strong> I’m setting up Power Automate to trigger an email and Teams notification. First, I’m pulling the approval status from the Purchase Orders table in Business Central, then setting a condition: if the approval is pending for more than 24 hours, it fires off notifications to both email and Teams.</p>
    <p><strong>AL Sorceress (chill as ever):</strong> I’m configuring the Approval Workflow in Business Central. It’s simple: two tiers of approval based on the purchase amount. Business Central’s built-in workflows handle it perfectly, and no custom coding nightmares.</p>
  </section>

  <section class="scene" id="scene6">
    <h3>Scene 6: The PM Chaos (Again)</h3>
    <p><strong>Project Manager Pete (talking fast, clearly panicking):</strong> Quick update! The client wants a last-minute field added to the Purchase Orders to track vendor ratings. No biggie, right? Just a tiny change... heh.</p>
    <p>(His coffee spills onto the sticky notes marked "Deadline.")</p>
    <p><strong>Code Crafter (grinning sarcastically):</strong> Oh, sure, Pete. Let me just extend the database, rebuild the API, re-code the front-end, and send it through QA. No problem at all...</p>
    <p><strong>AL Sorceress (rolling eyes, waving her staff):</strong> Relax, Pete. I’ll just add it as a custom field in Business Central, no dev needed. It’s literally a dropdown.</p>
  </section>

  <section class="scene" id="scene7">
    <h3>Scene 7: Conclusion</h3>
    <p><strong>Functional Force (confident):</strong> The client’s happy. Pete’s not panicking… for once. Mission accomplished!</p>
    <p><strong>Code Crafter (smirking):</strong> Business Central’s our playground, baby. Get ready for the next round of ‘last-minute requirements.’</p>
    <p><strong>AL Sorceress (with a wink):</strong> Magic and code… same thing, really.</p>
  </section>

  <footer>
    <p><em>Post-Credits Scene: Pete’s standing in front of the printer, which is flashing “Out of Paper” and jammed with sticky notes. He sighs deeply.</em></p>
    <p><strong>Project Manager Pete (to himself):</strong> I just wanted to schedule a meeting… is that too much to ask?</p>
  </footer>
</div>
</body>
</html><!--kg-card-end: html-->]]></content:encoded></item><item><title><![CDATA[Upgraded Pacific Islands Pest List Database (PLD) Workshop]]></title><description><![CDATA[<p>🌟 Exciting Announcement: Upgraded Pacific Islands Pest List Database (PLD) to Revolutionize Biosecurity Efforts and Trade in the Pacific Region! 🌱🌍🚀</p><p>I am thrilled to share some incredible news from the recent regional workshop in Nadi, Fiji, where the Pacific Community (SPC) introduced the newly upgraded Pacific Islands Pest List Database (PLD)</p>]]></description><link>https://navigating365.com/pest-list-database-conference/</link><guid isPermaLink="false">6477317ac12896048988e173</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Wed, 31 May 2023 11:39:24 GMT</pubDate><media:content url="https://navigating365.com/content/images/2023/06/IMG_6166-1.JPG" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2023/06/IMG_6166-1.JPG" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"><p>🌟 Exciting Announcement: Upgraded Pacific Islands Pest List Database (PLD) to Revolutionize Biosecurity Efforts and Trade in the Pacific Region! 🌱🌍🚀</p><p>I am thrilled to share some incredible news from the recent regional workshop in Nadi, Fiji, where the Pacific Community (SPC) introduced the newly upgraded Pacific Islands Pest List Database (PLD). As a Consultant/Software Engineer, I had the privilege of leading the team at KPMG that helped build this innovative system.</p><figure class="kg-card kg-gallery-card kg-width-wide kg-card-hascaption"><div class="kg-gallery-container"><div class="kg-gallery-row"><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/photo_2023-05-30_10-02-42.jpg" width="960" height="1280" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/photo_2023-05-30_10-12-05.jpg" width="960" height="1280" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/photo_2023-06-02_10-07-27.jpg" width="1280" height="960" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div></div></div><figcaption>The KPMG Team!&nbsp;</figcaption></figure><p>During the course of five days, our team at KPMG took on the responsibility of facilitating training sessions and empowering users to make the most of the system. Additionally, we dedicated a day to immersive field research, where we actively engaged with the PLD system while conducting surveillances for Fruit Flies.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2023/06/IMG_6088.JPG" class="kg-image" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"><figcaption>Day 5, hands on with the PLD, standing next to a Fruit Fly Trap!</figcaption></figure><p><br>With the PLD as our ally, we stood united in our mission to protect our region's agricultural resources and facilitate safe trade. The presence of the Fruit Fly Trap served as a poignant reminder of the challenges we face, fueling our determination to leverage technology and collaborative efforts to overcome them.</p><p>This experience has truly enriched my understanding of diverse backgrounds and cultures from over eight countries in the Melanesian and Polynesian sub-regions, and I am forever grateful to all the participants who taught me valuable lessons along the way. 🙏 Learning from their unique backgrounds and cultures is something I will forever cherish. 🙌</p><p>With the generous support of the European Union through the SAFE Pacific project, as well as the Australia Department of Agriculture, Fisheries and Forestry (DAFF) and the New Zealand Ministry for Primary Industries (MPI), this workshop became a resounding success. Together, we are laying the foundation for a safer, more efficient trade environment. 🌐🌿</p><p>By unifying the pest lists that were previously scattered across Pacific Island countries, the PLD fosters collaboration and cooperation among trading partners. It enables a comprehensive understanding of plant pest and disease risks, ensuring food safety and security through safe trade. With over 26,000 pest occurrences, spanning more than 10,000 pests across 2,200 host species, the PLD stands as a testament to our collective commitment to protecting the Pacific region. 🌍✨</p><p>The enhanced PLD, featuring a user-friendly web-based portal, has truly revolutionized access to vital information. From agricultural pest occurrences to export crop pest lists and notifications about pest incursions on imported goods, this database empowers decision-makers and strengthens border protection against destructive pests and diseases. The significance of these advancements cannot be overstated. 📈🔒</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2023/06/IMG_6166-2.JPG" class="kg-image" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"><figcaption>Field Emersion Day 5, Shoutout to Biosecurity Authority of Fiji for organizaing our research day!</figcaption></figure><p>Looking ahead, similar training on the PLD will soon be conducted in the Micronesian region, further strengthening biosecurity efforts and trade facilitation across the Pacific. Together, we are driving positive change and shaping the future of agriculture in our region. 🌱💪</p><p>To my colleagues at The Pacific Community, I extend my heartfelt appreciation for your dedication, passion, and unwavering commitment to protecting our region. It is through our collective efforts that we can create a more resilient and sustainable future. Let's celebrate this milestone and continue our mission of safeguarding agriculture and facilitating trade in the South Pacific.</p><p>Please join me in celebrating this remarkable achievement by liking, sharing, and spreading the word about the upgraded PLD. Together, we can make a lasting impact and foster a more resilient and sustainable future for the Pacific.</p><figure class="kg-card kg-gallery-card kg-width-wide"><div class="kg-gallery-container"><div class="kg-gallery-row"><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/05/photo_2023-05-30_10-02-41.jpg" width="960" height="1280" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/05/photo_2023-05-30_11-43-35.jpg" width="960" height="1280" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/05/photo_2023-05-30_11-43-37.jpg" width="960" height="1280" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div></div><div class="kg-gallery-row"><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/IMG_6166.JPG" width="6000" height="4000" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/MicrosoftTeams-image--28-.png" width="1600" height="720" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/SPC-PLD.jpg" width="6000" height="4000" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div></div><div class="kg-gallery-row"><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/IMG_5987.JPG" width="6000" height="4000" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div><div class="kg-gallery-image"><img src="https://navigating365.com/content/images/2023/06/IMG_5910.JPG" width="6000" height="4000" alt="Upgraded Pacific Islands Pest List Database (PLD) Workshop"></div></div></div></figure><p><br></p>]]></content:encoded></item><item><title><![CDATA[Machine Learning in Climate Finance]]></title><description><![CDATA[Leveraging smart computation and algorithms to help solve a problem is what we do best, and as it turns out, Climate Change is one such growing area where lots of problems need smart solutions.
That's where we come in.  ]]></description><link>https://navigating365.com/machine-learning-in-climate-finance/</link><guid isPermaLink="false">60e6a43500f60304b37ed2ba</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Mon, 15 Mar 2021 07:41:00 GMT</pubDate><media:content url="https://navigating365.com/content/images/2021/07/markus-spiske-r1BS0pzlr1M-unsplash.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2021/07/markus-spiske-r1BS0pzlr1M-unsplash.jpg" alt="Machine Learning in Climate Finance"><p><strong>What is a practical application of machine learning in motivating climate finance assessments?</strong></p><p><strong>Well for starters, what is Climate Finance?</strong></p><p>Climate finance is “finance that aims at reducing emissions, and enhancing sinks of greenhouse gases and aims at reducing vulnerability of, and maintaining and increasing the resilience of, human and ecological systems to negative climate change impacts”, as defined by the United Nations Framework Convention on Climate Change (UNFCCC) Standing Committee on Finance.</p><p>In Short, it is very important and understanding the paradigms and processes in successfully implemented assessments is one of the first steps towards an accurate plan to address climate adaptation and mitigation goals from strategy, through till implementation.</p><p><strong>Why should we, as Software Engineers care?</strong></p><p>Well, leveraging smart computation and algorithms to help solve a problem is what we do best, and as it turns out, Climate Change is one such growing area where lots of problems need smart solutions.</p><p><u>That's where we come in.  </u></p><blockquote>Climate Change AI is a global initiative to catalyze impactful work at the intersection of climate change and machine learning.  </blockquote><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://www.climatechange.ai"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Climate Change AI</div><div class="kg-bookmark-description">Tackling Climate Change with Machine Learning</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://www.climatechange.ai/favicon.ico" alt="Machine Learning in Climate Finance"><span class="kg-bookmark-publisher">Climate Change AI</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://www.climatechange.ai/images/CCAI_social_share_image.png" alt="Machine Learning in Climate Finance"></div></a></figure><p>One <a href="https://www.climatechange.ai/papers/icml2019/36/paper.pdf">very interesting paper</a> demonstrates a direct benefit in Climate Finance Assessment process through innovative Machine Learning Techniques.</p><p>The paper proposes GainForest, a video prediction tool with remote sensing capabilities to monitor and forecast forest change at high resolutions.  This tool enables the assessment of GHG impact, as well as links them with the corresponding payments - which promotes transparency and accountability for Measurement, Reporting and Verification by better informing REDD+ policies stakeholders.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2021/07/image.png" class="kg-image" alt="Machine Learning in Climate Finance"><figcaption>Given past deforestation (pink) patterns from Global Forest Watch (left image), a video prediction model is able to forecast in which regions a deforestation pattern is likely going to spread to in the near future (blue boxes, right image) <u>Source:</u> climatechange.ai</figcaption></figure><p> Payment Allocation Problem in Climate Finance - This application steps a benchmark for moving towards performance-based payments by reporting Feature Value Contribution. </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2021/07/image-1.png" class="kg-image" alt="Machine Learning in Climate Finance"><figcaption>It is proposed to solve the payment allocation problem as a <u>feature selection problem</u></figcaption></figure><p>Tools such as these are quiet vital in ensuring that funds allocated are measured against real world value. Machine Learning Techniques such as Computer Vision Models, and ETL processes such as Feature Selection have been used in industry to achieve great results. </p><p>It will be very interesting to see other applications of ML towards Climate Finance Domains. In this blog, we only looked at Forest Conservation, however, as it is evident ML can be applied in addressing Climate Change Goals, and its success is prevalent in helping us hit our Climate Adaptation and Mitigation Strategies efficiently. </p><p>The area between machine learning and climate change is a fascinating one, and I look forward to presenting more papers, and hopefully more code in this space.  </p>]]></content:encoded></item><item><title><![CDATA[[Business Central] Single Instance Codeunits]]></title><description><![CDATA[How can a global variable be accessed in business central through AL Extension Development?]]></description><link>https://navigating365.com/business-central-single-instance-codeunits/</link><guid isPermaLink="false">6049d36aa4f6f904b2c48543</guid><category><![CDATA[Business Central]]></category><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Thu, 11 Mar 2021 08:48:00 GMT</pubDate><media:content url="https://navigating365.com/content/images/2021/03/Capture.PNG" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2021/03/Capture.PNG" alt="[Business Central] Single Instance Codeunits"><p>Single Instance codeunits are essentially an implementation of the Singleton Design Pattern. In <a href="https://en.wikipedia.org/wiki/Software_engineering">software engineering</a>, the <strong>singleton pattern</strong> is a <a href="https://en.wikipedia.org/wiki/Software_design_pattern">software design pattern</a> that restricts the <a href="https://en.wikipedia.org/wiki/Instantiation_(computer_science)">instantiation</a> of a <a href="https://en.wikipedia.org/wiki/Class_(computer_programming)">class</a> to one "single" instance.</p><p>Every object that refers to a codeunit unit of this type will receive the same instance. </p><p><strong>I recently had the need to ask myself how can a global variable be accessed in business central through AL Extension Development? </strong></p><p>I had found Single Instance Codeunit as the natural first choice. More research material online is needed around this type of codeunit, and I couldn't really get the needed answers to my questions. So I decided to do a quick experiment to figure it out.</p><p>To solidify my choice, I experimented with two separate Business Central Sessions as per below - </p><p>I created one Single Instance Codeunit, and One Counter Manager Page that Increments/Decrements a Counter variable in the Single Instance Codeunit. I launched two instances of the web client and noted my findings. </p><p>On the left, You will see the value of Counter as 3. We can exit the page, carry on with our business and when we come back to the page, we will still see the value as 3. Even if we keep incrementing the global counter in the second session. </p><figure class="kg-card kg-image-card kg-width-full"><img src="https://navigating365.com/content/images/2021/03/image-3.png" class="kg-image" alt="[Business Central] Single Instance Codeunits"></figure><p>I was able to deduce from this that Single Instance Codeunits aren't server side, but exist in the application scope, and the lifetime of the instance is limited to the current client. This was good enough for my purposes. </p><p>Find below the code - </p><figure class="kg-card kg-code-card"><pre><code class="language-al">codeunit 50100 "Counter Management" implements ICounterManagement
{
    SingleInstance = true;

    var
        counter: Integer;

    procedure Increment()
    begin
        counter += 1;
    end;

    procedure Decrement()
    begin
        counter -= 1;
    end;

    procedure GetCurrentCounter(): Integer
    begin
        exit(counter);
    end;
}

interface ICounterManagement
{
    procedure Increment();
    procedure Decrement();

    procedure GetCurrentCounter(): Integer;
}
</code></pre><figcaption>codeunit 50100 "Counter Management" and interface ICounterManagement</figcaption></figure><figure class="kg-card kg-code-card"><pre><code class="language-al">page 50100 "Counter Manager"
{

    Caption = 'Counter Manager';
    PageType = Document;
    ApplicationArea = Suite;
    UsageCategory = Tasks;

    layout
    {
        area(content)
        {
            group(General)
            {
                field(Counter; CounterManagement.GetCurrentCounter())
                {
                    ApplicationArea = All;
                    Caption = 'Current Counter';
                }
            }
        }
    }

    actions
    {
        area(Processing)
        {
            action(IncrementCounter)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Increment Global Counter';
                Image = Add;
                trigger OnAction()
                begin
                    CounterManagement.Increment();
                    CurrPage.Update();
                end;
            }
            action(DecrementCounter)
            {
                ApplicationArea = Basic, Suite;
                Caption = 'Decrement Global Counter';
                Image = Delete;
                trigger OnAction()
                begin
                    CounterManagement.Decrement();
                    CurrPage.Update();
                end;
            }
        }
    }
    var
        CounterManagement: Codeunit "Counter Management";
}
</code></pre><figcaption>page 50100 "Counter Manager"</figcaption></figure><p>Code here: </p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://github.com/Kushal5/Single-Instance-Codeunits-BC"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Kushal5/Single-Instance-Codeunits-BC</div><div class="kg-bookmark-description">How can a global variable be accessed in business central through AL Extension Development? - Kushal5/Single-Instance-Codeunits-BC</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.githubassets.com/favicons/favicon.svg" alt="[Business Central] Single Instance Codeunits"><span class="kg-bookmark-author">Kushal5</span><span class="kg-bookmark-publisher">GitHub</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://avatars.githubusercontent.com/u/17171560?s=400&amp;v=4" alt="[Business Central] Single Instance Codeunits"></div></a></figure><p></p><p>More details here: </p><p><a href="https://docs.microsoft.com/en-us/dynamics-nav/singleinstance-property"><a href="https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-singleinstance-property">https://docs.microsoft.com/en-us/dynamics-nav/singleinstance-property</a></a></p><p><a href="http://partnersource.ru/cside.en/html/0456b0e3-873e-427b-8ef5-b9bb0ac7ba6e.htm">http://partnersource.ru/cside.en/html/0456b0e3-873e-427b-8ef5-b9bb0ac7ba6e.htm</a></p>]]></content:encoded></item><item><title><![CDATA[Notifications in Business Central AL]]></title><description><![CDATA[How to create notifications safely on the active page in Business Central using AL?]]></description><link>https://navigating365.com/notifications-in-business-central/</link><guid isPermaLink="false">5fe3efe5c5eb030ee89e2a3f</guid><category><![CDATA[Business Central]]></category><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Thu, 24 Dec 2020 01:41:47 GMT</pubDate><content:encoded><![CDATA[<p>How to create notifications safely on the active page in Business Central using AL?</p><figure class="kg-card kg-code-card"><pre><code class="language-al">var 
      MyNotification: Notification;
    
    local procedure ShowNotification()
    var
        NotificationMessage: Label 'Your Notification Message.';
    begin
        MyNotification.Scope := NotificationScope::LocalScope;
        MyNotification.Message := NotificationMessage;
        if ShouldNotify then
            MyNotification.Send()
        else
            if not (IsNullGuid(MyNotification.Id)) then
                MyNotification.Recall();
    end;</code></pre><figcaption>codeunit 50100 "Counter Management" and interface ICounterManagement</figcaption></figure><p>What is important to note is that you must do a IsNullGuid check before you attempt to recall your notification. If there is no active notification, it will shoot an error message.</p><p>Reference -</p><p><a href="https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-notifications-developing">https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/devenv-notifications-developing</a></p><p><a href="https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/guid/guid-data-type">https://docs.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/methods-auto/guid/guid-data-type</a></p>]]></content:encoded></item><item><title><![CDATA[Dapper Contrib - Easy CRUD Method]]></title><description><![CDATA[So far, we have looked at CRUD operations by implementing the operations ourselves using SQL.

Dapper Contrib takes it up one step further and provides us with a neat methods to do the CRUD tasks for us. ]]></description><link>https://navigating365.com/dapper-part-3/</link><guid isPermaLink="false">5ebb32d3c5eb030ee89e291b</guid><category><![CDATA[.NET]]></category><category><![CDATA[Dapper]]></category><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Tue, 12 May 2020 23:52:33 GMT</pubDate><media:content url="https://navigating365.com/content/images/2020/05/Jenesys-0398.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2020/05/Jenesys-0398.jpg" alt="Dapper Contrib - Easy CRUD Method"><p>So far, we have looked at CRUD operations by implementing the operations ourselves using SQL.</p><p>Dapper Contrib takes it up one step further and provides us with a neat methods to do the CRUD tasks for us. </p><p>For example - notice the difference between GetAll() and UpdateAll()</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/05/image.png" class="kg-image" alt="Dapper Contrib - Easy CRUD Method"><figcaption>UserRepository.cs</figcaption></figure><p>Dapper.Contrib has the following Generic Members available to us: </p><figure class="kg-card kg-code-card"><pre><code class="language-cs">T Get&lt;T&gt;(id);
IEnumerable&lt;T&gt; GetAll&lt;T&gt;();
int Insert&lt;T&gt;(T obj);
int Insert&lt;T&gt;(Enumerable&lt;T&gt; list);
bool Update&lt;T&gt;(T obj);
bool Update&lt;T&gt;(Enumerable&lt;T&gt; list);
bool Delete&lt;T&gt;(T obj);
bool Delete&lt;T&gt;(Enumerable&lt;T&gt; list);
bool DeleteAll&lt;T&gt;();</code></pre><figcaption>Dapper.Contrib Generic Members</figcaption></figure><p>For a more detailed breakdown of what the code does, you can refer to the Dapper repository on Github, its open source which is fantastic!</p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://github.com/StackExchange/Dapper"><div class="kg-bookmark-content"><div class="kg-bookmark-title">StackExchange/Dapper</div><div class="kg-bookmark-description">Dapper - a simple object mapper for .Net. Contribute to StackExchange/Dapper development by creating an account on GitHub.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.githubassets.com/favicons/favicon.svg" alt="Dapper Contrib - Easy CRUD Method"><span class="kg-bookmark-author">StackExchange</span><span class="kg-bookmark-publisher">GitHub</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://avatars2.githubusercontent.com/u/1393171?s=400&amp;v=4" alt="Dapper Contrib - Easy CRUD Method"></div></a></figure><p>More on this - </p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://stackoverflow.com/questions/5957774/performing-inserts-and-updates-with-dapper"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Performing Inserts and Updates with Dapper</div><div class="kg-bookmark-description">I am interested in using Dapper - but from what I can tell it only supports Query and Execute. I do not see that Dapper includes a way of Inserting and Updating objects. Given that our project (m...</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon.png?v=c78bd457575a" alt="Dapper Contrib - Easy CRUD Method"><span class="kg-bookmark-author">Slaggg</span><span class="kg-bookmark-publisher">Stack Overflow</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://cdn.sstatic.net/Sites/stackoverflow/Img/apple-touch-icon@2.png?v=73d79a89bded" alt="Dapper Contrib - Easy CRUD Method"></div></a></figure><p>Hope this helps. </p><p>Post Picture: Overlooking From A Plane , Fiji Islands. Shot by: <a href="https://navigating365.com/microsoft-dynamics-nav-dapper-part-1/facebook.com/VijeshDattPhotography">VijeshDattPhotography</a>. </p><p>During the current Global Pandemic, International Travel is restricted and we cannot welcome tourists at the moment. In the meantime, I hope that I can share with you the beauty of Fiji through my blog. </p><p>Here is an excellent message from Fiji Airways.</p><blockquote>When the time is right we will be here to welcome you back to our home. From our Fijian family to yours…Sota Tale. It’s not goodbye, just see you later.</blockquote><figure class="kg-card kg-embed-card"><iframe width="480" height="270" src="https://www.youtube.com/embed/5s4bY5xQUHg?feature=oembed" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe></figure>]]></content:encoded></item><item><title><![CDATA[Ls One: On the Use of Micro ORMS]]></title><description><![CDATA[Sometimes, we need self contained queries, without wanting to change a lot of areas of the standard code base.

I managed to get Dapper up and running for Ls One. now instead of creating providers etc for simple queries, I use my approach. ]]></description><link>https://navigating365.com/ls-one-dapper-part-2/</link><guid isPermaLink="false">5ea110a4c5eb030ee89e2831</guid><category><![CDATA[LsOne]]></category><category><![CDATA[.NET]]></category><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Thu, 23 Apr 2020 04:01:48 GMT</pubDate><media:content url="https://navigating365.com/content/images/2020/04/ROC-09.jpg" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2020/04/ROC-09.jpg" alt="Ls One: On the Use of Micro ORMS"><p>This is a post that builds on from my <a href="https://navigating365.com/microsoft-dynamics-nav-dapper-part-1/">first post</a> on Dapper.  </p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://navigating365.com/microsoft-dynamics-nav-dapper-part-1/"><div class="kg-bookmark-content"><div class="kg-bookmark-title">Microsoft Dynamics NAV: On the Use of Micro ORMS</div><div class="kg-bookmark-description">Sometimes we need to communicate with a NAV Database, and generally the legacy approach I have seen is to call Stored Procedures, or in very rare cases, utilize ADO.NET within your application. Recently, I attempted to utilize an Object Relational Mapper to help with this.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://navigating365.com/favicon.ico" alt="Ls One: On the Use of Micro ORMS"><span class="kg-bookmark-author">Kushal Pillay</span><span class="kg-bookmark-publisher">Navigating 365</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://navigating365.com/content/images/2020/03/LRM_EXPORT_15545126155303_20191004_163558171--1-.jpeg" alt="Ls One: On the Use of Micro ORMS"></div></a></figure><p>Sometimes, we need self contained queries, without wanting to change a lot of areas of the standard code base.</p><p>I managed to get Dapper up and running for Ls One. now instead of creating providers etc for simple queries, I use my approach. </p><p>Ls One does not inherit the standard IDbConnection, it instead has its own IConnectionManager,  and IConnection. however, we are in luck because IConnection has a definition called ExecuteReader that returns an IDataReader.</p><p>The previous process was to manually map whatever IDataReader returns, field by field.</p><p>Instead, We can use the SqlMapper Parse feature documented here - </p><figure class="kg-card kg-bookmark-card"><a class="kg-bookmark-container" href="https://github.com/StackExchange/Dapper"><div class="kg-bookmark-content"><div class="kg-bookmark-title">StackExchange/Dapper</div><div class="kg-bookmark-description">Dapper - a simple object mapper for .Net. Contribute to StackExchange/Dapper development by creating an account on GitHub.</div><div class="kg-bookmark-metadata"><img class="kg-bookmark-icon" src="https://github.githubassets.com/favicons/favicon.svg" alt="Ls One: On the Use of Micro ORMS"><span class="kg-bookmark-author">StackExchange</span><span class="kg-bookmark-publisher">GitHub</span></div></div><div class="kg-bookmark-thumbnail"><img src="https://avatars2.githubusercontent.com/u/1393171?s=400&amp;v=4" alt="Ls One: On the Use of Micro ORMS"></div></a></figure><!--kg-card-begin: markdown--><pre><code>    public class ShippingType
    {
        public int Code { get; set; }
        public string Name { get; set; }
    }

    public interface IShippingTypeRepository
    {
        List&lt;ShippingType&gt; GetAll(IConnectionManager entry);
    }
    
            public class ShippingTypeRepository: IShippingTypeRepository
    {

        public List&lt;ShippingType&gt; GetAll(IConnectionManager entry)
        {
            List&lt;ShippingType&gt; ShippingTypes = new List&lt;ShippingType&gt;(); 
            
            using (System.Data.SqlClient.SqlCommand cmd = new SqlCommand())
            {
                cmd.CommandText = &quot;SELECT * FROM TransportDetails&quot;;
                System.Data.IDataReader _dr = null;
                try
                {
                    _dr = entry.Connection.ExecuteReader(cmd, System.Data.CommandType.Text);
                    **ShippingTypes = (SqlMapper.Parse&lt;ShippingType&gt;(_dr)).ToList();**

                }
                catch (Exception e)
                {
                    Console.WriteLine(e);
                    throw;
                }
                finally
                {
                    if (_dr != null)
                    {
                        _dr.Close();
                        _dr.Dispose();
                    }
                }

                return ShippingTypes;
            }
        }
    }</code></pre>
<!--kg-card-end: markdown--><p>I think I will be using this approach for the foreseeable future :)</p><p>Post Picture: Trees in Toorak , Fiji Islands. Shot by: <a href="https://navigating365.com/microsoft-dynamics-nav-dapper-part-1/facebook.com/VijeshDattPhotography">VijeshDattPhotography</a></p>]]></content:encoded></item><item><title><![CDATA[Microsoft Dynamics NAV: On the Use of Micro ORMS]]></title><description><![CDATA[Sometimes we need to communicate with a NAV Database, and generally the legacy approach I have seen is to call Stored Procedures, or in very rare cases, utilize ADO.NET within your application. Recently, I attempted to utilize an Object Relational Mapper to help with this.]]></description><link>https://navigating365.com/microsoft-dynamics-nav-dapper-part-1/</link><guid isPermaLink="false">5e800a85c5eb030ee89e27a0</guid><category><![CDATA[Dynamics NAV]]></category><category><![CDATA[.NET]]></category><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Sun, 29 Mar 2020 03:59:48 GMT</pubDate><media:content url="https://navigating365.com/content/images/2020/03/LRM_EXPORT_15545126155303_20191004_163558171--1-.jpeg" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2020/03/LRM_EXPORT_15545126155303_20191004_163558171--1-.jpeg" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"><p>Sometimes we need to communicate with a NAV Database, and generally the legacy approach I have seen is to call Stored Procedures, or in very rare cases, utilize ADO.NET within your application.</p><p>While the above technologies work fine, there is a lot of manual work between mapping different entities and fields. Recently, I attempted to utilize an Object Relational Mapper to help with this.</p><p>You will quickly find that there are lots of libraries to help you with this, the most popular being the Entity Framework. However, For my purposes, I did not require such a power library. I was looking for something lightweight, that specifically did the job of Mapping. </p><p>Introducing <a href="https://dapper-tutorial.net/">Dapper </a>- A super fast library for mapping between databases and .NET objects. In this post, I am going to show how we can utilize the benefits of this library should you ever need a good mapping utility. In my examples, I am connecting to a Dynamics NAV Database, with CRONUS data. </p><p>Lets start with the Datalayer. Open Visual Studio, and create a Service Library. I am using .NET Core 2.0 but you can use whatever flavor of .NET you prefer. </p><p><strong>Data Layer</strong></p><ol><li>Add Dapper, and Dapper.Contrib as a Dependency via Nuget</li></ol><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/image-6.png" class="kg-image" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"></figure><p>2. Lets create a Model. In this case, Lets say we want Customer details.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/03/image-7.png" class="kg-image" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"><figcaption>Customer.cs</figcaption></figure><p>3. We will be creating a Repository Pattern for our Data Access Layer. Lets create a Repository for Customer.</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/03/image-8.png" class="kg-image" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"><figcaption>ICustomerRepository.cs</figcaption></figure><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/03/image-9.png" class="kg-image" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"><figcaption>CustomerRepository.cs</figcaption></figure><p>What about the DB Connection? We will add the following code to use dependency injection via constructor - </p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/03/image-10.png" class="kg-image" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"><figcaption>CustomerRepository.cs</figcaption></figure><p>Now to write the query that will return Customers using Dapper -</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/03/image-12.png" class="kg-image" alt="Microsoft Dynamics NAV: On the Use of Micro ORMS"><figcaption>CustomerRepository.cs</figcaption></figure><p>As you can see, when using a micro ORM such as Dapper, we have control over the SQL, without the tedious task of mapping. </p><p>And that is it. All you need now is to call your data layer from your application, and pass in the connection string. </p><p>Also, I will be posting great shots of Fiji Islands in this blog as a way to showcase Fiji to our international readers :)</p><p>Post Picture: Maui Bay, Fiji Islands. Shot by: <a href="https://navigating365.com/microsoft-dynamics-nav-dapper-part-1/facebook.com/VijeshDattPhotography">VijeshDattPhotography</a></p>]]></content:encoded></item><item><title><![CDATA[Quick Fix: Visual Studio 2017 displaying NAV Report Layout as XML]]></title><description><![CDATA[I have a problem with Visual Studio 2017 Professional Edition not displaying the NAV Report Layouts properly. It would open up as XML every time, instead of the visual layout.]]></description><link>https://navigating365.com/quick-fix-visual-studio-2017-displaying-nav-report-layout-as-xml/</link><guid isPermaLink="false">5e7a0f3dc5eb030ee89e273b</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Tue, 24 Mar 2020 13:49:54 GMT</pubDate><media:content url="https://navigating365.com/content/images/2020/03/1111.PNG" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2020/03/1111.PNG" alt="Quick Fix: Visual Studio 2017 displaying NAV Report Layout as XML"><p>I have a problem with Visual Studio 2017 Professional Edition not displaying the NAV Report Layouts properly. It would open up as XML every time, instead of the visual layout.</p><p>To Fix this issue, we should first update our Visual Studio to the latest version. We need to also install <a href="https://docs.microsoft.com/en-us/sql/ssdt/download-sql-server-data-tools-ssdt" rel="nofollow noopener"><strong>"Microsoft SQL Server Data Tools"</strong></a> for Visual Studio 2017. Make sure to install all( SQL Server Database, Analysis Services, Reporting Services and Integration Services).</p><p>We need to also ensure that SQL Data Tools is checked in Visual Studio. To do this, Navigate to Tools -&gt; Get Tools and Features -&gt; Check Data Storage and Processing Tabs and make sure that SQL Data Tools is checked.</p><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/image-5.png" class="kg-image" alt="Quick Fix: Visual Studio 2017 displaying NAV Report Layout as XML"></figure><p><strong>*Restart your PC</strong></p><p>Now open up Visual Studio 2017, Tools -&gt; Extensions and Updates -&gt; Online -&gt; Search for Microsoft Rdlc Report Designer and install it. This may follow another restart. Do that and fire up Visual Studio again. The VSIX installer will run automatically and will stop. It will display that it is waiting for these applications to close(with their Process IDs). What I did was to close those Processes from Task Manager, after that the installer continued to install that.</p><p>Should this not work for you, in which case something is playing up with your SSDT and VS versioning, you will have to manually download Microsoft Integrations Services and Microsoft Analysis Services as Extensions from the Extensions and Updates menu in VS 2017.</p><p>Thats it! Your Visual Studio 2017 should now be opening RDLC reports in its proper format.</p><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/image-4.png" class="kg-image" alt="Quick Fix: Visual Studio 2017 displaying NAV Report Layout as XML"></figure><p>Special Thanks to @Tharanga N. Chandrasekara for the <a href="https://community.dynamics.com/nav/b/tharangacnavblog/archive/2017/03/12/quick-fix-visual-studio-displaying-nav-report-layout-as-xml" rel="nofollow noopener">2015 Visual Studio Solution </a>for NAV Reporting.</p>]]></content:encoded></item><item><title><![CDATA[.NET Interoperability Tricks: Dynamics NAV: Generic Lists<​T> in C/AL]]></title><description><![CDATA[Working with .NET in Dynamics NAV 2018 is cool. It feels like you are writing C/AL armed with the full might and strength of an Asgardian god. There is a good amount of tutorials online that help us understand how this interoperability works.]]></description><link>https://navigating365.com/net-interoperability-tricks-dynamics-nav-generic-lists-t-in-c-al/</link><guid isPermaLink="false">5e7a0e1fc5eb030ee89e271b</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Tue, 24 Mar 2020 13:46:07 GMT</pubDate><media:content url="https://navigating365.com/content/images/2020/03/2.png" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2020/03/2.png" alt=".NET Interoperability Tricks: Dynamics NAV: Generic Lists<​T> in C/AL"><p>Working with .NET in Dynamics NAV 2018 is cool. It feels like you are writing C/AL armed with the full might and strength of an Asgardian god. There is a good amount of tutorials online that help us understand how this interoperability works.</p><p>Recently, I was in need to model a List&lt;T&gt; where T could be any type of class. I will demonstrate how this can be achieved. As an example, we will attempt to model a NAV Purchase Order and NAV Purchase Lines.</p><p><strong>Step 1: Create a .NET Standard Class Library in Visual Studio</strong></p><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/image.png" class="kg-image" alt=".NET Interoperability Tricks: Dynamics NAV: Generic Lists<​T> in C/AL"></figure><p><strong>Step Two: The Purchase Order Class and Purchase Lines Class</strong></p><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/image-1.png" class="kg-image" alt=".NET Interoperability Tricks: Dynamics NAV: Generic Lists<​T> in C/AL"></figure><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/image-2.png" class="kg-image" alt=".NET Interoperability Tricks: Dynamics NAV: Generic Lists<​T> in C/AL"></figure><p><br><strong>Step Three: The C/AL Code</strong></p><p>PurchaseOrder := PurchaseOrder.NAVPurchasOrder();</p><p>PurchaseOrder.DocumentType := ‘Order’;</p><p>PurchaseOrder.No := ‘PO1000’;</p><p>Now its time to set values for our Items. But how do we do that? Lets say there are 2 Items in this PO. We would first have to</p><p>REPEAT</p><p>//Somehow add NAV Items to a List&lt;NAVItems&gt;</p><p>UNTIL NAVPurchaseLine.NEXT = 0</p><p>First, we need a List Variable:</p><p><strong>NavItemsList: System.Collections.Generic.List`1.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'</strong></p><p></p><p>Next, we need to Tell NAV that this List is of type dotnet NAVPurchaseLines. To do this, I figured out a quick and easy way using the NavItemsList constructor. C/AL will make this of Type whatever the constructor returns.</p><p>So in our Purchase Order class, we can create a function that returns a List&lt;NAVPurchaseLines&gt; as such:</p><p><strong>public List&lt;NAVPurchaseLines&gt; InitializeNavPurchaseLines()</strong></p><p><strong>{</strong></p><p><strong>return new List&lt;NAVPurchaseLines&gt;();</strong></p><p><strong>}</strong></p><p>in C/AL:</p><p><strong>NavItemsList := PurchaseOrder.</strong> <strong>InitializeNavPurchaseLines();</strong></p><p>Now we can loop through the Items:</p><p>NavItem: .NET Type of NAVLibrary.PurchaseLines</p><p>REPEAT</p><p><strong>NavItem:=NavItem.NAVItem;</strong></p><p>NavItem.DocumentType:= ‘Order’;</p><p>NavItem.BuyFromVendorNo:= ‘31314’;</p><p>NavItem.DocNo:= ‘PO1000’;</p><p>NavItem.LineNo:= ‘1000’;</p><p><strong>NavItemsList.Add(NavItem);</strong></p><p>UNTIL NAVPurchaseLine.NEXT = 0;</p><p>And Finally, we can add our NavItemsList to our Purchase Order class</p><p><strong>Type := GETDOTNETTYPE(PurchaseOrder);</strong></p><p><strong>Type.GetProperty(‘PurchaseLines’).SetValue(PurchaseOrder,NavItemsList);</strong></p><p>Which this technique, We are easily able to add Any Type of List to our Class from C/AL!</p><p>SO.MUCH.POWER</p><figure class="kg-card kg-image-card kg-card-hascaption"><img src="https://navigating365.com/content/images/2020/03/image-3.png" class="kg-image" alt=".NET Interoperability Tricks: Dynamics NAV: Generic Lists<​T> in C/AL"><figcaption>C/AL Developer after discovering .NET interop for the first time!!!</figcaption></figure>]]></content:encoded></item><item><title><![CDATA[Using IEnumerator to iterate through a .NET Framework collection in Dynamics NAV]]></title><description><![CDATA[In C/AL, You can use the FOREACH statement to iterate through a .NET Framework collection or array object. It is the recommended approach, and provides a very simple construct for C/AL programmers:]]></description><link>https://navigating365.com/using-ienumerator-to-iterate-through-a-net-framework-collection-in-dynamics-nav/</link><guid isPermaLink="false">5e7a0ce2c5eb030ee89e26ff</guid><dc:creator><![CDATA[Kushal Pillay]]></dc:creator><pubDate>Tue, 24 Mar 2020 13:39:00 GMT</pubDate><media:content url="https://navigating365.com/content/images/2020/03/0.png" medium="image"/><content:encoded><![CDATA[<img src="https://navigating365.com/content/images/2020/03/0.png" alt="Using IEnumerator to iterate through a .NET Framework collection in Dynamics NAV"><p>In C/AL, You can use the FOREACH statement to iterate through a .NET Framework collection or array object. It is the recommended approach, and provides a very simple construct for C/AL programmers:</p><p></p><blockquote>FOREACH &lt;Element&gt; IN &lt;List&gt; DO     &lt;Statement&gt;</blockquote><p></p><p>The &lt;List&gt; variable must be a DotNet data type that is set to .NET Framework collection or array type.</p><p>In .NET, much of the repetitive constructs we use in our day to day lives as a programmer, like the Whlie Loop/For Loop etc are all implementations of the IEnumerator.</p><p>Today, I will show you how you can use the IEnumerator in NAV. Although it is always recommended to use the FOREACH statement, it is useful to know what goes on under the hood.</p><blockquote>NavListEnumerator : System.Collections.Generic.IEnumerator`1.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'NavList: .NET Framework or Collection  NavListItem:  </blockquote><blockquote><em>// Initialize .NET List to a NavList of Type &lt;NavListItem&gt;</em></blockquote><blockquote>NavList := GetListType();  </blockquote><blockquote>NavListEnumerator := NavList.GetEnumerator(); </blockquote><blockquote>WHILE NavListEnumerator.MoveNext() DO BEGIN </blockquote><blockquote>NavListItem := NavListEnumerator.Current; MESSAGE(FORMAT(NavListItem.Amount)); </blockquote><blockquote>END;</blockquote><p>I actually was in need of a way to iterate through a .NET Collection, and thought of this approach to solve the problem, later on, I found out that FOREACH already does this for us. Doesn't hurt to tinker around, always take the red pill ;)</p><p></p><figure class="kg-card kg-image-card"><img src="https://navigating365.com/content/images/2020/03/1.png" class="kg-image" alt="Using IEnumerator to iterate through a .NET Framework collection in Dynamics NAV"></figure>]]></content:encoded></item></channel></rss>