AX / Dynamics 365 For Finance and Operations blog

  • Contacts
  • Articles
  • Categories

Ultimi articoli

←Previous Page

  • D365FFO – AX – X++ Select Statements That Look More Like SQL

    2 April 2021

    As I’ve progressed as an AX developer, I’ve had to lean on many of the skills that I had from a former job as a C# developer where I used a lot of SQL queries. Working with data in X++ is similar until you try to write it like it would be written in SQL.…

    AX – D365FFO, Query, SQL Statements, X++

  • Expressions in query ranges

    2 April 2021

    One of least understood but most powerful Axapta features is the so-called Expressions in query ranges syntax. This is not the same as simply using a QueryBuildRange object in a query and specifying a criteria for a single field. Contents  [hide]  1 Introduction 2 Syntax 3 Examples 3.1 Simple criteria 3.2 Complex criteria with combined AND and OR clauses 3.3 WHERE clauses referencing fields from…

    AX – D365FFO, Query, Query ranges, X++

  • D365FFO – AX – X++ – Create and Post Purchase Order Invoice

    2 April 2021

    Find below job to create and post purchase order in Dynamics AX 2012 Note: Referring contoso demo data, ‘CEU’ company static void CreatePOAndInvoice(Args _args) { PurchTable      purchTable;PurchLine       purchLine;VendTable       vendTable = VendTable::find(“3008”);AxPurchTable    axPurchTable;AxPurchLine     axPurchLine;PurchFormLetter purchFormLetter; //Create Purchase orderpurchTable.initFromVendTable(vendTable); axPurchTable = axPurchTable::newPurchTable(purchTable);axPurchTable.parmPurchaseType(PurchaseType::Purch);axPurchTable.parmDocumentStatus(DocumentStatus::PurchaseOrder);axPurchTable.parmAccountingDate(systemDateGet());axPurchTable.parmDeliveryDate(016\2012);axPurchTable.parmPurchStatus(PurchStatus::Backorder);axPurchTable.doSave(); //Create PurchLine for item 1000purchLine.initFromPurchTable(purchTable); axPurchLine = AxPurchLine::newPurchLine(purchLine);axpurchLine.parmItemId(“1000”);axPurchLine.parmPurchQty(10);axPurchLine.parmPurchPrice(100);axPurchLine.doSave(); //Posting PO Confirmation,I guess its mandatory//You cannot…

    AX – D365FFO, Purchase Orders, X++

  • D365FO – AX – X++ – Extension method data accessor examples

    2 April 2021

    Source Event Parm Example Class Pre/Post event XppPrePostArgs Get args and parmameter values from a method that is being extended. Parm 1 = Object Parm 2 = CommonPurchCreateFromSalesOrder callingClass = args.getThis() as PurchCreateFromSalesOrder;       Object callerObject = args.getArgNum(1) as Object;Common callerRecord = args.getArgNum(2) as Common; Class Pre/Post event XppPrePostArgs Class example: SalesLineType salesLineType = args.getThis() as SalesLineType; …

    AX – D365FFO, Extensions, X++

  • D365FFO – AX – X++ – How to: Pass multiple data source records to Class with MultiSelectionHelper

    2 April 2021

    Good day everyone, Today I will continue talking about how to pass multiple records to class, this time I will do it using the helper class MultiSelectionHelper. The MultiSelectionHelper class provides an interface to work with multiple selected records on a form data source and which can be cached, if called on server it will…

    AX – D365FFO, MultiSelectionHelper, X++

  • D365 / AX – X++ – How to get multiple selected records in control level event handlers

    2 April 2021

    Purpose:The purpose of this document is to show how to get multiple selected records in form control event handlers. Development:First of all create new event handler class HRPayrollPayStatementEventHandler and subscribe to form button OnClicked event handler. /// /// The HRPayrollPayStatementEventHandler class is the event handler class for managing PayrollPayStatement form events ///class HRPayrollPayStatementEventHandler{ }

    AX – D365FFO, Data source, Event handlers, Multiple records selection, MultiSelectionHelper, X++

  • D365FFO – AX – X++ – Simple dialog with field validation and control override method

    2 April 2021

    Simple dialog with field validation and control override method: class VKSalesOrderCloseDialog extends RunBase{DialogField dlgHoldCode,dlgReasonCode,dlgNotes;MCRHoldCode holdCode;RetailInformationSubcodeId reasonCode;Notes notes; }Object dialog(){Dialog dialog = super(); }boolean getFromDialog(){holdCode = dlgHoldCode.value();reasonCode = dlgReasonCode.value();notes = dlgNotes.value(); }public container pack(){//return [#CurrentVersion,#CurrentList];return [#CurrentVersion];}public MCRHoldCode parmHoldCode(MCRHoldCode _holdCode = holdCode){holdCode = _holdCode; }public Notes parmNotes(Notes _notes = notes){notes = _notes; }public RetailInformationSubcodeId parmReasonCode(RetailInformationSubcodeId _reasonCode =…

    AX – D365FFO, Forms, Methods Override, RegisterOverrideMethod, Simple Dialog, X++

  • AX / D365FO – Create a simple RunBase with Dialog through X++

    2 April 2021

    Add a new Runnable class and rename it CustTableDlg: Create a dialog method to capture runtime user inputs for customer details: Override the method getFromDialog, the code below will be used to retrieve the Dialog field values: Override the method run, use it to process whatever you want to. On my example I will use…

    AX – D365FFO, Forms, Simple Dialog, X++

  • Runbasebatch – D365FFO – X++ – AX

    1 April 2021

    This article shows how to create and use a RunBaseBatch class : http://www.axaptapedia.com/RunBaseBatch

    AX – D365FFO, Forms, RunBaseBatch, X++

  • Updating Vendor Address using X++ – D365FFO -AX

    1 April 2021

    Hi, Vendor address state value can be retrieved from tables VendTable, DirPartyTable, DirPartyLocation, LogisticsLocation and LogisticsPostalAddress (or) through the view DirPartyPostalAddressView(mentioned in the blogs suggested by Vilmos) You can use the following job(query) to get the data and to update the state:static void VendorState(Args _args){VendTable vendTable;DirPartyTable dirPartyTable;DirPartyLocation dirPartyLocation;LogisticsLocation logisticsLocation;LogisticsPostalAddress logisticsPostalAddress;LogisticsAddressState LogisticsAddressState; while select vendTablewhere vendTable.AccountNum…

    AX – D365FFO, Vendor, X++

  • Here is the code to create form data-source extension class – D365FFO – AX – X++

    1 April 2021

    [ExtensionOf(formdatasourcestr(HcmWorker, HcmWorker))]

    AX – D365FFO, Data source, Extensions, X++

  • How joins in X++ select statement are translated into T-SQL – D365FFO – AX

    1 April 2021

    It is not always obvious what request is actually executed on SQL Server. The most confusing is probably exists join in X++. Let’s analyze how joins in select statement in X++ are translated into T-SQL statement sent to SQL Server. 1. join in X++: select AccountNum from custTablejoin TaxGroupId from custGroupwhere custGroup.CustGroup == custTable.CustGroup; CROSS JOIN in T-SQL: SELECT T1.ACCOUNTNUM,…

    AX – D365FFO, Query, Query joins, SQL Statements, X++

  • Creating and revising the Project Budget from Project Forecasts in D365FFO – AX – X++

    1 April 2021

    With the following code we can able to import the project budget and revising too

    AX – D365FFO, Project budget, Project Forecast, X++

  • D365FFO – X++ – Extend a Form

    1 April 2021

    [ExtensionOf(formStr(ProjStatistic))].

    AX – D365FFO, Extensions, Forms, X++

  • AX – D365FFO – X++ – close methods on a form

    1 April 2021

    There are “only” 5 ways to close a form:1. Close – close the form2. CloseOK – close the form, and set the OK flag – called by the commandbutton: Ok3. CloseCancel – close the form, and set the Cancel flag – called by the commandbutton: Cancel4. CloseSelectRecord – close the lookup form, and set return record5. CloseSelect – close the lookup form, and set return…

    AX – D365FFO, Close methods, Forms, X++

  • AX2012 – Code Profiler (Benchmarks)

    1 April 2021

    Wait for a while for the second line to appears Press “Pofile runs”

    AX – D365FFO, Code Profiler, Performance monitor, Utility

  • Find reference in AX2012

    1 April 2021

    AX – D365FFO, Find References

  • AX / D365FO – X++ – Expressions in query ranges

    1 April 2021

    One of least understood but most powerful Axapta features is the so-called Expressions in query ranges syntax. This is not the same as simply using a QueryBuildRange object in a query and specifying a criteria for a single field. Contents  [hide]  1 Introduction 2 Syntax 3 Examples 3.1 Simple criteria 3.2 Complex criteria with combined AND and OR clauses 3.3 WHERE clauses referencing fields from…

    AX – D365FFO, Query, Query ranges, X++

  • D365FFO – AX – X++ – Custom Lookup for a dialog field

    1 April 2021

    This post discusses about creating a custom lookup field on a dialog.Following are the methods and code required to achieve the purpose.(Assuming the class is extending the RunbaseBatch) –> A lookup method is required in the first place. Below is the sample code to lookup the exchange rates.private void exchRate_Lookup(FormStringControl _control){SysTableLookup sysTableLookUp;QueryBuildDataSource qbds;Query query =…

    AX – D365FFO, Forms, Lookup method, Simple Dialog, X++

  • D365FFO – AX – Display all/specific AOT tables in a lookup

    1 April 2021

    For displaying all/specific AOT objects like tables in the lookup control, we need to iterate the UtilidElements table with our desired criteria. static void lookupAOTTables(FormStringControl _ctrl){    SysTableLookup              sysTableLookup = SysTableLookup::newParameters(tablenum(UtilidElements), _ctrl);    Query                       query = new Query();    QueryBuildDataSource    …

    AOT, AX – D365FFO, Tables, Utility, X++

  • AX – D365FFO – Check item on-hand quantity

    1 April 2021

    AX – D365FFO, Inventory Management, On-hand Quantity, User Interface

  • D365FO – AX : X++ code to get on hand on an item

    1 April 2021

    Hi Friends,In this post I would like to share a small piece of code using which we can get oh hand values for an item. Before jumping to it I would first like to share some basic information related to on hand information.What do we need to know when we have to calculate on hand…

    AX – D365FFO, Inventory Management, On-hand Quantity, X++

  • D365FFO – AX – X++ – Query On-Hand inventory using specific inventory-dimensions

    1 April 2021

    Using the class InventDimOnhand, you can determine the on-hand inventory of articles and/or specific inventory-dimensions. The following job determines the inventory for a specific item and a specific inventlocation. This is grouped per color. static void getInventOnhandExample(Args _args) { ItemId itemId; InventDimOnHand inventDimOnHand; InventDimParm inventDimParmOnHandLevel; InventDimOnHandIterator inventDimOnHandIterator; InventDimOnHandMember inventDimOnHandMember; InventDim inventDim; InventDim inventDimCriteria; InventDimParm inventDimParmCriteria; //…

    AX – D365FFO, InventDim, InventDimOnHand, Inventory Management, On-hand Quantity, X++

  • D365FFO – Table Browser via web browser

    1 April 2021

    In previous versions of AX you had a table browser in the AOT which allowed you to view the data, modify or delete it while executing any table methods that may have been associated with it. In D365 you can no longer access the table browser the same way as you not longer have access…

    AOT, AX – D365FFO, Table Browser, Tables

  • D365FO – AX 2012: Confirm Purchase Order in X++

    1 April 2021

    Purpose: The purpose of this document is to illustrate how we can confirm purchase orders in X++ using PurchParmTable table and PurchFormLetter class. Business requirement: Ability to confirm purchase order automatically. As of now Standard AX offers manual purchase order confirmation by clicking Procurement and sourcing > Common > Purchase orders > All purchase orders > Purchase > Generate > Confirm. Assumptions: The purchase order…

    AX – D365FFO, Purchase Order confirmation, Purchase Orders, Purchase Orders, X++

  • D365FO – AX – X++ – Dynamics AX Tutorial – X++ Containers Functionality

    1 April 2021

    Why Containers? In X++ (Object oriented programming language) the data or values stored in a Variable are of below types: Primitive dataTypes – int, str, real …. etc. Composite dataTypes – Arrays, Containers, Collection Classes Temporary Tables For instance, Primitive dataType variable can hold only 1 value and that too of same dataType, if you want to…

    AX – D365FFO, Containers, X++

  • D365FFO – AX – X++ – InventOnHand Vs InventDimOnHand

    1 April 2021

    What the difference between InventOnHand and InventDimOnHand classes and in what cases they must be used? Axapta InventOnHand class is wrapper for InventSum table. Unique index for InventSum table is ItemId + InventDimId. In other word, this class is used to get on hand for item with specific dimension. For example, if you require getting on-hand qty…

    AX – D365FFO, InventDim, InventDimOnHand, Inventory Management, Utility, X++

  • D365FFO / AX – Enable “Records to include” filter in a RunBaseBatch class – X++

    13 November 2020

    To enable “Records to include” filter in a RunBaseBatch class just set these two methods like shown below public QueryRun queryRun()    {        next queryRun();        return   queryRun;    } public boolean showQueryValues()    {        next showQueryValues();        return true;    }

    AX – D365FFO, Forms, RunBaseBatch, X++

  • D365FFO / AX – Get Current User Name – X++

    13 November 2020

    This function will return the name associated with the current user. If you just want the current user ID, use curUserId() XUserInfo::find(false, curUserId()).name;

    AX – D365FFO, Current User, X++

  • D365FFO / AX – Call an instance method of the same class – X++

    25 October 2020

    If you are inside a class and want to call an instance method that belong to the same class you can call it by using this.{method_name}. Example :

    AX – D365FFO, Class instance, Class method, X++

  • D365FFO – AX – Filter a non-empty value – X++

    25 October 2020

    If you want to check if a string field has a non-empty value you can use sysquery::valueNotEmptyString() method Some examples: //Make a query that extract all PurchLine rows with PurchId with a non-empty value : this.query().dataSourceTable(tableNum(PurchLine)).addRange(fieldNum(PurchLine,PurchId)).value(sysquery::valueNotEmptyString());

    AX – D365FFO, Query

  • D365FFO / AX – Align the header status of a purchase order based on the status of the lines (LowestPurchStatus) with x++

    5 August 2020

    AX – D365FFO, Purchase Orders

←Previous Page
  • Subscribe Subscribed
    • AX / Dynamics 365 For Finance and Operations blog
    • Join 158 other subscribers
    • Already have a WordPress.com account? Log in now.
    • AX / Dynamics 365 For Finance and Operations blog
    • Subscribe Subscribed
    • Sign up
    • Log in
    • Report this content
    • View site in Reader
    • Manage subscriptions
    • Collapse this bar