Sunday, April 13, 2025

Simulate Posting - Posting Validation Check- Concept

Abstract : Basically Simulate Posting performs  few checks  during posting which can't be done at the time of 'Validation'. It executes same logic which it executes during posting to address any missing info and proceed with successful posting.

Problem Statement:Earlier we had only two options under validate : Validate and Validate voucher only.Problem with them was they were checking each and every checks and balances which are require to post the transaction. So, many times user will get error while posting though at the time of validation it was ok.

Solution:  As solution -  new option Simulate posting performs all check and balances which system does at the time of posting.If Simulate posting is ok then user will not get any error while posting.

When "Simulate posting" is selected, the system runs the posting process as it would normally, but instead of actually updating the ledger, it displays any error messages or warnings that would occur during a real posting. 







Benefits:

Reduces errors: By identifying and resolving issues before posting, it minimizes the risk of incorrect postings. 

Saves time: It eliminates the need to reverse and correct postings due to errors. 

Improved efficiency: It allows for faster and more accurate posting of journals. 

Reference: Please check the following post on Microsoft docs regarding "Simulate posting"


General journal processing - Finance | Dynamics 365 | Microsoft Learn

Wednesday, March 12, 2025

 Fixing Dynamics Lifecycle Services (LCS) Asset Upload Failure in Automated Pipelines

Recently, we encountered an issue where our automatic pipelines were failing at the "Dynamics Lifecycle Services (LCS) Asset Upload" step with the following error:

Issue reported:  "The specified module 'AzureRM' was not loaded because no valid module file was found in any module directory."
✅ Solution: Switching to Version 2 resolves this issue.


However, if you run into another error:
❌ "Invalid OAuth token",
then updating the LCS Connection API

 Platform updates for version 10.0.43 of finance and operations apps (December 2025) - Finance & Operations | Dynamics 365 | Microsoft Learn

10.0.43 / CY25Q2 is GA

Thursday, December 7, 2023

Chain of Commands Vs Event Handler in D365 / D365 FO Functions Classes Concept

 COC(Source from MS Learn): Chain of Command (CoC) enables strongly typed extension capabilities of public and protected methods. It is an amazing piece of development capability that allows technical consultants to extend the application avoiding over-layering.

Objects that can use COC:

  • Classes
  • Tables
  • Forms
  • Data Entities
  • Datasource on a form.
  • Data field on a form.
  • Control of a form.

Events handlers can be used only for Public methods.

Further ,COC focuses on extending methods in base classes, while event handlers focus on reacting to events during application execution

-----------------------------------------------------------------------------------------------------------------------------------------

D365 FO Functions , Classes - Basics

Static Functions: They can be called without creating an instance of the class. They're commonly used for utility functions that don't rely on instance-specific data. These functions are tied to the class rather than an instance. 

Instance Functions: They operate on the data that belongs to the object and are responsible for object-specific behavior. These functions require an instance of the class to be invoked. 

Main Method: This is the entry point for class execution, usually for testing or batch processing. The main() method is static and can accept command-line arguments.

Abstract Functions: Derived classes must provide an implementation for these functions, making them ideal for defining a common interface. These functions don't have any implementation in the base class. 

Final Functions: This ensures that the implementation of the function remains consistent. These are functions that cannot be overridden in derived classes. 

Classes:

Global Class: This class contains global methods and variables that can be accessed across the application, serving as a utility hub.

Application Classes: Classes like Info, ClassFactory, and Global that serve specific application-level functionalities.

Sys Classes: These are system-level classes such as SysDictTable, SysQuery, and SysFormRun. They are crucial for interacting with system-level functionalities and metadata.

Framework Classes: These classes provide foundational structures for common functionalities. Classes like Run Base and RunBaseBatch are examples that provide a standardized way to create batch jobs or runnable classes.

Helper Classes: These are custom-defined classes that encapsulate shared logic or functionalities that can be reused across modules.

Controller Classes: These classes act as mediators in complex operations like reporting or batch processing, organizing the overall execution flow.

Contract Classes: These are used to encapsulate parameters for services or reports, making it easier to manage and validate the input.

Data Provider Classes: Used primarily for SSRS reports, these classes gather the data that is then displayed on the report.

Extension Classes: These allow you to add new methods to existing table, form, or class objects without altering the original codebase.

Attribute Classes: These are special classes that act as metadata, allowing you to tag elements in the code for additional behaviors or properties.

Map Classes: These simulate tables but don't involve data storage in the database. They're useful for temporary data manipulation tasks.

Table Classes: These classes directly represent tables in the AOT (Application Object Tree). They're automatically created and can be extended but not modified.

Form Classes: These are auto-generated when you create a form in the AOT. They contain methods that run form logic and control form events.





Wednesday, February 14, 2018

To identify list of General journal which are not getting posted for current entity

/// To identify list of General journal which are not getting posted for current entity
static void Piy_DailyGJrnlNotPosted(Args _args)
{
    LedgerJournalTable      ledgerJournalTable;

    while select RecId, Posted,JournalType,JournalNum,journalName from ledgerJournalTable
        where ledgerJournaltable.dataAreaId == curext()
            && ledgerJournalTable.Posted == NoYes::No
    {
        info(strFmt("Journal Number %1 - %2", ledgerJournalTable.JournalNum,ledgerJournalTable.JournalName));
    }
}

To monitor Number Sequences which are going to be consumed with given parameter

// To moniter consumption of Number Sequence //
//Created for Monitoring for number sequence
static void NumSeqMonitoringDetails(Args _args)
{
    NumberSequenceTable NumberSequenceTable;
    NumberSequenceCode  NumberSequence;
    int differenceCount;
    int highest,usedCount;
    int numseqvaluedifference = 10000;
 // Enter the criteria to check number sequence with remaining consumption numbers. [ Remaining //Numbers <5000]


    while select NumberSequence,Txt,Highest,NextRec
             from NumberSequenceTable
                      where NumberSequenceTable.Continuous == NoYes::Yes &&
                                 NumberSequenceTable.Highest - NumberSequenceTable.NextRec <= numseqvaluedifference
    {
        differencecount = NumberSequenceTable.Highest - NumberSequenceTable.NextRec;

        info(strFmt("%1 - %5, HighestNumber: %2, UsedNumber: %3 , Difference : %4",NumberSequenceTable.NumberSequence,NumberSequenceTable.Highest,NumberSequenceTable.NextRec,differencecount,NumberSequenceTable.txt));

    }
}