Friday, October 30, 2026

Inventory visibility in D365FO

 Inventory visibility

1. InventInventoryDataServiceBatchJobTask => Method (create)

2. InventSum => InventInventoryDataServiceInventSumBatchJobTask

3. OnHandChangeSchedule => InventInventoryDataServiceOnhandChangeScheduleBatchJobTask

4. WhsInventReserve => InventInventoryDataServiceWhsInventReserveBatchJobTask


Tuesday, September 1, 2026

Skip Inventory reservation on Sales order lines in D365FO

[ExtensionOf(classStr(InventUpd_Reservation))]

final class InventUpd_ReservationCls_SAN_Extension

{

    void updateNow()

    {

        if(movement != null && movement.buffer())

        {

            curBuffer = movement.buffer();

            switch(curBuffer.TableId)

            {

                case tableNum(SalesLine) :

                    salesLine = curBuffer;

                    salesTable = salesLine.salesTable();

                    break;

            }

            

            if(salesLine && salesTable)

            {

                    if()// add requires if needed for reservsation skip

                    {

                              reservation = 0; //To stop reservation

                    }

                }

        next updateNow();

    }

Thursday, August 6, 2026

Export label custom content

 GRID => Properties

"Export Label" => "SalesReportMexico"


To get download file with custom naming. 

Thursday, July 9, 2026

validateExistCommonRecord in D365FO X++

validateExistCommonRecord(

    RefTableId _refTableId,

    RefRecId _refRecId)

{

    boolean ret = true;

    if (!_refTableId || !_refRecId)

    {

        ret = CheckFailed(strFmt("Incorrect parameter for the function called ", funcName()));

    }


    if (ret)

    {

        Common record = new DictTable(_refTableId).makeRecord();


        select firstonly RecId from record

            where record.RecId == _refRecId;


        if (!record.RecId)

        {

            ret = checkFailed("Record not found");

        }

    }


    return ret;

}

Friday, June 5, 2026

Azure Function Apps

Content copied from AI.

Azure Function Apps provide a serverless, event-driven compute service that lets you run code in languages like C#, Python, JavaScript, and Java without managing infrastructure. They scale automatically, offering a cost-effective "pay-per-use" model suitable for processing data, integrating systems, and building APIs.

Key Aspects:

  • Serverless Architecture: You focus solely on code, while Azure handles infrastructure, provisioning, and maintenance.
  • Event-Driven Triggers: Functions run in response to events, such as HTTP requests, queue messages, or timer schedules.
  • Development Flexibility: Supports multiple languages including C#, Java, JavaScript, PowerShell, Python, TypeScript, and more.
  • Integration: Easily connects to other services using triggers and bindings without writing extensive code.
  • Deployment Options: Allows deployment via the Azure portal, Visual Studio Code, GitHub, and Azure DevOps.
  • Task Automation: Executing scheduled tasks or timer-based jobs.
  • Security: Inherits security features from Azure App Service, including Azure Active Directory (AD) integration.
  • Hosting Plans: Options include Consumption (pay-per-use), Premium (enhanced performance), and Dedicated (App Service plan)

Prerequisites:

  1. Visual Studio
  2. Azure Subscription

Azure Functions => Trigger types (Most commonly used triggers)

  1. HTTP trigger: Triggers your function via HTTP requests.
  2. Timer trigger: Executes your function at specified time intervals.
  3. Blob trigger: Executes your function on any creation or modification of a blob in Azure Storage.
  4. Queue trigger: Executes your function when a new message is added to an Azure Storage queue.
  5. Event Grid trigger: Listens for events published by Azure services or custom applications via Azure Event Grid.
  6. Service Bus trigger: Listens for messages on an Azure Service Bus queue or topic subscription.
  7. Event Hub trigger: Processes events from an Azure Event Hub.
  8. Durable Functions: Provides patterns for long running and stateful workflows, including orchestration and chaining of multiple function calls. 
  9. Etc, Lof of other trigger also availables.

 

 


Friday, May 8, 2026

Get or set adjust tax calculated amount using TAXDOCUMENT framework (Tax calculation service) in D365FO

 //Get or adjust tax calculation using TAXDOCUMENT framework (Tax calculation service)

TaxRegulation taxRegulationDetail;

TmpTaxRegulation  tmpTaxRegulationDetail;

SalesTotals salesTotals;


salesTotals = SalesTotals::construct(SalesTable::find(salesLineParentPOl.SalesId), SalesUpdate::All);

salesTotals.calc();


taxRegulationDetail = TaxRegulation::newTaxRegulation(salesTotals.tax());

tmpTaxRegulationDetail.setTmpData(taxRegulationDetail.tmpTaxRegulation()); // Get all current tax by order wise


//Get this buffer "tmpTaxRegulationDetail" to get all tax related data

//To adjust

TaxTable    taxTable;

select firstonly tmpTaxRegulationDetail

    where tmpTaxRegulationDetail.TaxCode

    join taxTable

        where taxTable.TaxCode == 'SAN_IPI';

if(tmpTaxRegulationDetail)

{

    taxRegulationDetail.updateTaxRegulationAmount(tmpTaxRegulationDetail, (<Updated tax amount after adjustment>), true); // to adjust use this call to do

    taxRegulationDetail.saveTaxRegulation(); //

}

Monday, May 4, 2026

Get Vendor & Warehouse primary address using query

 --Vendor default primary address

Select  vt.AccountNum, vt.Party, vt.RecId, lpd.RECID, dpl.LOCATION, lpd.ADDRESS from VENDTABLE vt

join DirPartyLocation dpl on dpl.Party = vt.Party

join LogisticsPostalAddress lpd on dpl.LOCATION = lpd.LOCATION

where vt.DataAreaId = 'usrt' and dpl.ISPRIMARY =1 and lpd.VALIDTO = '2154-12-31 23:59:59.000'


--Warehouse default primary address

Select  it.InventLocationId, it.INVENTSITEID, it.RecId, lpd.RECID,  lpd.ADDRESS

from INVENTLOCATION it

join InventLocationLogisticsLocation illl on illl.INVENTLOCATION = it.RECID

join LogisticsPostalAddress lpd on lpd.LOCATION = illl.LOCATION

where it.DataAreaId = 'usrt' --and dpl.ISPRIMARY =1 

and illl.IsPostalAddress =1 and illl.IsPrimary =1 and lpd.VALIDTO = '2154-12-31 23:59:59.000'


Wednesday, April 1, 2026

WMS Mobile app flow - Adding Detour fields for Process guided framework custom implementation

 WMS Mobile app flow

=> Adding Detour fields for Process guided framework custom implementation

Before fix:



Adding code fix to get thos requires field.

/// <summary>

/// WHS APP FLOW Detour fields implementation SAN_WHSMobileAppFlowPOLMovementLPCreation

/// Run Create Default setup from Mobile device steps

/// </summary>

[WHSWorkExecuteMode(WHSWorkExecuteMode::SAN_MovementLP)]

class SAN_WHSMobileAppFlowPOLMovementLPCreation extends WHSMobileAppFlow

{

    protected void initValues()

    {

        // add available fields

        this.addAvailableField(extendedTypeNum(InventSerialId));

        this.addAvailableField(extendedTypeNum(WHSLicensePlateId));

        this.addAvailableField(extendedTypeNum(ItemId));

    }

}


Post fix:



Wednesday, March 4, 2026

Error readable from string in D365FO

 Reference class: RetailSyncOrdersSchedulerTask

Error readable:

private str generateHumanReadableErrorDetail(System.Exception _exception, str _errorDetail = '')

{

    str errorDetail, exceptionType, stackTrace, exceptionMessage;


    errorDetail = _errorDetail;

    // When the CLR error encounters it gets the inner exception message, call stack and stores in Database.

    if (_exception && _exception.InnerException)

    {

        if (_exception.InnerException.InnerException && _exception.InnerException.StackTrace)

        {

            // Use inner exception if it is available as it is often more descriptive.

            errorDetail = errorDetail ? errorDetail +

                        _exception.InnerException.InnerException.Message : _exception.InnerException.InnerException.Message +

                         _exception.InnerException.StackTrace.ToString();

        }

        else if (_exception.InnerException.StackTrace)

        {

            errorDetail = _exception.InnerException.Message +  _exception.InnerException.StackTrace.ToString();

        }

        else

        {

            // When the exeption not returns a call stack, we get the call stack from the <c>Xsession<c> object.

            errorDetail = _exception.InnerException.Message + con2str(xSession::xppCallStack());

        }

    }


    return errorDetail;

}

Sunday, February 1, 2026

Replaces the value of the specified dimension attribute from source to target in D365FO


Replaces the value of the specified dimension attribute from source to target =>

LedgerDimensionDefaultFacade::serviceReplaceAttributeValue(<source dimension>, <target dimension>, DimensionAttribute::findByName("<Dimension name>").RecId);

Inventory visibility in D365FO

 Inventory visibility 1. InventInventoryDataServiceBatchJobTask => Method (create) 2. InventSum => InventInventoryDataServiceInventSum...