AX / Dynamics 365 For Finance and Operations blog

  • Contacts
  • Articles
  • Categories

Ultimi articoli

←Previous Page Next Page→

  • AX – D365FO – Create Reference and Replacement groups

    6 July 2021

    First create a new Table “Al0VendorSearchCriteria” AccounNum is take from VendTable.accountNum StatesId is of type Int64 Al0VendorActicivityId is of type Int64 (taken from another custom table that could be seen in my article : https://d365ffo.com/2021/07/04/ax-d365fo-create-a-simple-and-detail-tree-form/ Create a relation betewwn Al0VendorSearchCriteria and Al0Activity Create Extended datat types for the 2 fields Create a new form of…

    Reference group, Replacement Groups

  • AX – D365FO – Simple Details Form patterns

    4 July 2021

    This article describes the Simple Details form pattern. This pattern is used when only a simple set of fields must be presented to the user. Usage The Simple Details pattern is used when only a simple set of fields must be presented to the user. Examples include the display of totals and customer balances. Typically,…

    Form patterns, Forms, Simple Details Form patterns

  • AX – D365FO – Create a Simple and Detail – Tree Form

    4 July 2021

    This article is dedicated to my colleague Andrew Nearness This example shows how to create a “Simple and create Detail – Tree” Form This is the result we want to obtain First create Extended data types Al0VendorActivityId of type Int64 Al0VendorActivityName of type String Al0VendorActivityHierarchyId of type Int64 Then create “Al0VendorActivity” table Add these fields…

    Form patterns, Forms, FormTreeControl, Simple and detail – Tree, X++

  • AX – D365FO – Create a Data Entity to export all Vendor Contact informations (Emails, Phones, etc..)

    3 July 2021

    This example will show how to create a Data Entity to export all Vendor Contact informations like emails and phone numbers. First create a Data Entity (to do this read my article : https://d365ffo.com/2021/06/29/ax-d365fo-create-a-data-entity) Then you have to insert Table Data sources and link them together : Click FInish Synchronize database and Build the solution…

    Data Entities, Data management, Vendor

  • AX – D365FO – Refresh Data Entity List

    3 July 2021

    This is how to Refresh data entity to make it visible in Data Entity framework in D365FO. Open D365FO, go to System Administrator, Data Management Click on Framework parameters Switch to Entity settings and click on “Refresh Entity list”. Wait until job will finish. It will take some times. After job has finished you can…

    Data Entities, Data management

  • AX – D365FO – Vendors contacts informations (Emails, telephones, etc..)

    3 July 2021

    Vendor

  • AX – D365FO – How to solve error “The model element was saved with unparsable source code and cannot be used”

    1 July 2021

    Error: The model element was saved with unparsable source code and cannot be used. Please edit the element in Visual Studio to fix the errors: (CUS) [] K:\AosService\PackagesLocalDirectory\bin\XppSource\\.xpp Possible reason: Sometimes when we rename the object name in code and manually rename the object from Solution explorer, respective metadata still pointing to old names. Suggested Solution:This issue doesn’t fix even…

    X++

  • AX – D365FFO – FormTreeControl – Change the display label (Text) on a FormTreeItem

    1 July 2021

    In a Tree view te default label is RecId and Name. If you want to change it follow this code Another way to modify Tree node name showing only node description instead of RecId is to use the new method of class CcFormTreeDatasource in your TreeView Form

    FormTreeControl, X++

  • AX – D365FO – Add columns in a Form Grid

    1 July 2021

    Forms

  • AX – D365FO – How to intercept the onclick event of a Form system buttons (New, Delete)

    29 June 2021

    How to intercept the onclick event of New (SystemDefinedNewButton) or Delete (SystemDefinedDeleteButton) system buttons of a Form? in your Form you have to use task method

    X++

  • AX – D365FO – Export a Data Entity

    29 June 2021

    Go to System Administrator, Data Management Click on “Export” Give a unique name to the “Group name” field Click on “Add entity” and a dialog form will appear. Choose the entity to export and the outputt format (i.e. EXCEL, etc..) Click “Close” These are all the supported output formats Click on “Export now”

    Data Entities, Data management

  • AX – D365FO – Create a Data Entity

    29 June 2021

    Open Visual Studio and create a new Data Entity item “DataEntityTest” A Wizard will opens. Choose the primary data source (i.e. VendTable). Click Next Choose the fields you want to show in your data entity. Click Finish Data Entity, Security Privileges and Staging Table will be created If you set “Is Read only” to No…

    Data Entities, Data management, X++

  • AX – D365FO – How to solve the error “The natural key for the table was not found” in a Data Entity #d365fo #ax #msdyn365fo

    28 June 2021

    Suppose you want to create a Data Entity fot VendCertification tablr. This table doesm’t have a unique key except for RecId (Which cannot be used) If you try to create entity and build this error eccurs “The natural key for the table VendCertification was not found“ How to solve this problem : Create an new…

    Data Entities, Data management, X++

  • AX – D365FO – Ho w to add a default value in a field and hide it in a Form grid

    26 June 2021

    Result to obtain go to “Vendor collaboration” –> “Vendor nformation” –>”Certifications” A form will be opened “VendTableVendExternal”and a grid will appear We want to set a default value for the field “Certifying organization” and hide it to the user. How to do this in X++ : Set Default value to the field First create the…

    Extensions, Forms, X++

  • AX – D365FO – How to obatain a table field name from a Form control

    26 June 2021

    Forms, System Administration

  • AX – D365FO – Add a new Reference group parameter in a Setup Form

    25 June 2021

    In this example we’ll explain how to add a new parameter in the “Project and Sourcing” menu, under “Procurement and sourcing parameters” Form Expected result : This is te expected result we want to obtain To do this in X++ : Create an extension of the “VendorInformationFormConfiguration” table Add a new field “Al0IssuerPartyDefaultValue” of type…

    Reference group, X++

  • AX – D365FO – Multiple Aggregations in X++ Join (Group by, SQL)

    24 June 2021

    Group by, SQL Statements, X++

  • AX – D365FO – Create and post a Transfer InventJournal in Dynamics AX 2012

    24 June 2021

    The sample code below creates a Transfer InventJournal and posts it

    InventJournal, X++

  • AX – D365FO – How to call Form with filtered records using code in AX 2012

    24 June 2021

    Suppose you have a Form and you want to call another form passing some filters. Go to Clicked() method of the “ViewSource” button and insert this code

    Query, QueryBuildDataSource, X++

  • AX – D365FO – Exclude some item Category from Cost/Revenue budget control

    21 June 2021

    This example shows how to exclude some item categories from cost or revenue budget control. For cost budget control : Create an extension class of SourceDocumentLineState class [ExtensionOf(classStr(SourceDocumentLineState))] final class Al0SourceDocumentLineState_Extension { /// <summary> /// Extension method /// </summary> /// <returns></returns> protected boolean validatePostTransition() { //Al0_0266_ProjBudgetExcludedCategoryItm – BEGIN //Excluding some Project Categories from Project Budget…

    X++

  • AX – D365FO – Create a Form grid and implement some event rules

    21 June 2021

    This example show how to add a grid in a Form. We’ll add 2 grids in a custom tab of the “Project and management and accounting parameters” Form (ProjParameters) This is the the result we will obtain Create an extension of the “ProjParameters” Form and add a new datasource. The datasource points to the custom…

    Forms, X++

  • AX – D365FO – Get FIeld value of a Common object

    17 June 2021

    If want to get the field value of a common object you can do this

    X++

  • AX – D365FO – Get first and last day of a month

    16 June 2021

    X++ Get Start Date and End Date of Month Use following methods to get Month Start Date and Month End Date. Pass any date of month in parameter. Month Start Date :  Month End Date :

    Date functions, X++

  • AX – D365FO – Find all references of a variable

    15 June 2021

    X++

  • AX – D365FO – Find all references of a label message

    15 June 2021

    First open the “Find labels” form in VS Then search your message, click on it with mouse right button and “Find references” It will redirect to all occurrences of the message

    System Administration

  • AX – D365FO – How to get the url of AX/D365FO home page in a LCS virtual machine

    15 June 2021

    System Administration

  • AX – D365FO – Get latest version of all custom objects from Visual Studio

    15 June 2021

    How to update all custom objects in a AX Development Virtual machine environment.

    System Administration, Visual Studio

  • AX – D365FO – How to access Demand Forecast Form

    10 June 2021

    AX – D365FFO, Forecast

  • AX – D365FO – How to set Workspace default directory for Projects and metadata

    10 June 2021

    Visual Studio, Workspaces, X++

  • Visualize line numbers in Visual Studio editor

    10 June 2021

    Utility, Visual Studio

  • AX – D365FO – Add a default value to a dialog field in a RunBase dialog (or RunBaseBatch)

    8 June 2021

    If you want to add a default value in a RunBase dialog field you can use dialog.addFieldValue() in the dialog() method : public Object dialog() { dialog = super(); dialog.addGroup(“@SYS7764”); dialogCurrency = dialog.addFieldValue(ExtendedTypeStr(CurrencyCode), ‘EUR’, “Currency”); return dialog; }

    RunBase, RunBaseBatch, X++

  • AX – How to add a file dialogField in a RunBase (or RunBaseBatch) dialog

    8 June 2021

    We need to add a file type dialog field in a RunaBase or RunBaseBatch dialog How to do in x++ Class Declaration class ImportDemandForecastCSV extends RunBaseBatch { DialogRunbase dialog; DialogField dialogFileName; FileName fileName; #define.CurrentVersion(1) #define.Version1(1) #localmacro.CurrentList fileName #endmacro } public Object dialog() { dialog = super(); dialog.addGroup(“@SYS7764”); dialogFileName = dialog.addField(ExtendedTypeStr(Filenameopen), “File Name”); return dialog; }…

    FileName field, RunBase, RunBaseBatch, X++

  • D365FFO – AX – SET Class

    7 June 2021

    Set consist of a data set that contains values of the same type, where value is unique. A Set is alway sorted on the value. Contents 1 How to use 1.1 Define 1.2 Insert a value 1.3 Exists value 1.4 Getting values 1.4.1 SetIterator 1.4.2 SetEnumerator 1.5 Removing values 1.6 Other methods 1.7 Passing across tiers 2 See also How to use[edit] Define[edit] <xpp> Set s =…

    set, X++

  • Install NuGet package in a specified project using Package manager console

    5 June 2021

    Install-Package Elmah -ProjectName MyProject

    Entity Framework, Package manager console, Visual Studio

  • D365FO – AX – Optimizing Record Inserts with RecordInsertList

    5 June 2021

    Array inserts, sometimes referred to as bulk inserts, are implemented in the kernel. They buffer a group of rows and insert them in a single trip to the SQL data store. This vastly reduces the number of trips, and speeds up inserts by approximately a factor of 2 – 10. You can use RecordSortedList or RecordInsertList to hold your…

    SQL Statements, X++

  • D365FO – AX – Count elapsed time with a Timer

    4 June 2021

    This is a simple job to count elapsed time

    X++

  • D365FO – AX – Import CSV file into a Table with RecordInsertList for best DB insert performance

    4 June 2021

    RecordInsertList, X++

  • D365FO – AX – Break Statement to exit from While, do-While, for statements

    4 June 2021

    With break keyword when used within a while, do…while, or for loop, the loop is terminated and execution continues from the statement following the loop as shown in the following example.

    X++

  • D365FO – AX – Convert String to Date (str2Date)

    4 June 2021

    This function is used to convert the specified string to a date value. There is 2 parameters in this function : _text : The string to convert to a date value. _sequence : A three digit integer that describes the positions of the day, month, and year in the string to convert (day = 1, month = 2, year…

    str2Date, X++

  • D365FO – AX – Convert a string into a container

    4 June 2021

    Suppose you have a CSV file that contains 100 lines and every line as 5 fields separated by a separator (comma, semicolon, pipe, etc..) Now you want to retrieve the lines and put every single field into a string. You can do it by using a container and str2con method How to do in X++…

    Containers, str2con, X++

  • D365FO – AX – Order By in Select Statements

    4 June 2021

    SalesTable salesTable; select salesTable index hint CustIdx order by CustAccount where salesTable.CustAccount >= ‘3000’ && salesTable.CustAccount <= ‘4000’ && salesTable.FixedDueDate >= 12\12\2004 && salesTable.FixedDueDate <= 05\05\2009;

    Query, select statement, X++

  • D365FO – AX – How to remove records from query results in Sales Quotation Edit lines (SalesQuotationEditLines)

    4 June 2021

    Imagine that you want to remove some record in a Query results in the “Select” functionality on the “Sales Quotation Edit Lines” Form during Sales Quotation Confirmation. The records that will be removed are the sales quotation that don’t have an attachment. Start from Sales quotation Table Form, click on sales quotation and click “Confirm”…

    Sales Quotation, X++

  • D365FO – AX – Get Prospect type in X++

    3 June 2021

    How to get in in X++

    Prospect, X++

  • D365FO – AX – Copy a label and insert into X++ code

    3 June 2021

    Open Label file, select the label, right click and choose “Copy” Paste the label into code wrapped by double quote

    Labels, X++

  • D365FO – AX – Looping through table buffer (QueryRun) multiple times

    2 June 2021

    queryRun queryRun;query query = new query(); CustTable custTable;query.addDataSource(tablenum(CustTable)); while (queryRun.next()){ custTable = queryRun.get(tablenum(CustTable)); // do something with the buffer …} queryRun.reset() while (queryRun.next()) // another loop process{ custTable = queryRun.get(tablenum(CustTable)); // do something other with the buffer …}

    QueryRun, X++

  • D365FO – AX – How To confirm a purchase order

    1 June 2021

    Accounts payable –> All purchas eorders –> select one purchase order in status “Approved” –>click “Cofirmation” –>Cliclk Ok on “Confirmpurchae order” Form

    Purchase Order confirmation

  • D365FO – AX – Purchase orders Setup form

    31 May 2021

    Procurement and sourcing –> Procuerement and sourcing parameters (in X++ the table is called PurchParameters)

    Purchase Orders

  • D365FO – AX – Import/Export a report from an environment to another

    31 May 2021

    Open the original environment, go to “SSRR Reports”, choose the report you want to export and click export Open the original environment, go to visual studio projects, Dynamics AX model Projects, choose the report you want to export and click export An xpo file will be generated. Save it Open the target environment, go to…

    AOT, Reports, SSRS – sql server reporting services

  • D365FO – AX – How to launch Data Management

    31 May 2021

    Data Entities, Data management

  • D365FO – AX – Hoe to retrieve Login environement Link to use in browser

    28 May 2021

    Goto –> https://lcs.dynamics.com/v2 Open Customer environemnt and Cloud_hosted environment Open the machine anc lick on Lo on to enviroenment

    LCS – Lifecycle Services

  • D365FO – AX – Convert an enum into a string

    28 May 2021

    Info(enum2Str(SalesStatus::Backorder)); //this will display ‘Open order’

    enum2Str, Enums, X++

  • D365FO – AX – Convert a value into an enum type (str2Enum)

    28 May 2021

    This example show how to convert a value into an enum type. If value cannot be converted the result of str2Enum is 255 SalesStatus salesStatus;str salesStatusValue = ‘Open order’; salesStatus = str2Enum(salesStatus,salesStatusValue); //Put enum type (SalesSatus) and Enum value (salesStatusValue) Info(enum2Str(salesStatus));

    str2Enum, X++

  • D365FO – AX – Import CSV file in a runnable class in X++

    27 May 2021

    This is a simple example to import a csv file in arunnable class in C365FFO You can run the class in various ways. If you know how read my article : https://d365ffo.com/2021/07/15/ax-d365fo-running-a-runnable-class-through-url-in-dynamics-365-for-operations/

    csv import, Runnable class, X++

  • D365FO – AX – SSRS – Call a custom report instead of a Standard report

    26 May 2021

    How to call a custom report instead of a standard report? Create an extension of the standard Controller class and use a Chain of command for the method “parmReportName()”

    Reports, SSRS – sql server reporting services, X++

  • D365FFO – AX – Get ABC code of a Customer or Prospect

    25 May 2021

    DirOrganization dirOrganization = DirOrganization::find(smmBusRelTable::find(“Put your customer Account here”).Party); ABC abc = dirorganization.ABC;

    ABC code, X++

  • AX2012: SysOperation Framework

    20 May 2021

    Here are 2 interesting articles that explain by examples how to implement forms with SysOperation Framework 1- https://amazingax.wordpress.com/2012/12/28/simple-use-of-sysoperation-framerwork-in-ax-2012-part-1datacontract/ 2- http://www.artofcreation.be/2011/08/21/ax2012-sysoperation-introduction/

    SysOperationFramework, X++

  • D365FO – AX – Create Planned Transfer Order in X++

    17 May 2021

    This is a simple job to create a planned Transfer order througth X++ static void PlannedTransferOrder(Args _args) {    ReqPo       ReqPo;    InventDim   inventDim;    InventDim   inventDimLocal;    ReqPlan                                 reqPlan;    ReqPlanData     reqPlanData;    ReqPlanId       reqPlanId = ‘Piano Generale’; //Here you put your preferred ReqPlanId    reqPlanData = ReqPlanData::newReqPlanId(reqPlanId);    ReqPo.clear();    ReqPo.initValue();    ReqPo.initReqPOType(reqPlanData.parmReqPlanVersionRefRecId(),reqPoType::Transfer);    ReqPo.initFromItemId (“440440”); //Here you put your ItemId    ReqPo.Qty = 11; //Here you put your…

    Planned Transfer Order, Transfer orders, X++

  • D365FO – AX – Change a dialog field value when another field value changes in a simple dialog form using registeroverride method

    17 May 2021

    On a Simple dialog form when the dialog checkbox “Ignore minimum qty” is false then disable the dialog checkbox “dialogShowUsrDialog” else enable it and set the value to true. To do this we need to call the registerOverrideMethod when declaring dialogfields and write a new modified method. public void openQtyParmsDialog() {    dialog = new Dialog(“Check Quantities”);    dialogIgnoreMinQty = dialog.addField(extendedTypeStr(NoYesId), “Ignore…

    FormCheckboxControl, RegisterOverrideMethod, Simple Dialog, X++

  • D365FO – AX – How to resolve error “Cannot edit a record in ….. table (….). An update conflict occurred due to another user process deleting the record or changing one or more fields in the record.”

    13 May 2021

    This error usually occurs when you are trying to update a table, but the table was previously updated by another operation. In this case it is advisable to call the reread () method of the table before updating. Something like that :

    reread(), X++

  • D365FO – AX – date2Str Function – Converts the specified date to a string

    13 May 2021

    Not so much an article but something which is very useful. If you are coding in X++ this is a function you will use a lot. If you don’t provide the correct or valid values to the formatting parameters if the specified values are not valid. To use the date format that the user specified in Regional…

    X++

  • D365FO – AX – Generate an exception and Write detailed error message while import a Data Entity

    12 May 2021

    This code describes how to generate an exception and write detail log error message while importing a Data Entity.

    Data Entities, Data management, X++

  • D365FO – AX – SSRS error: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs

    11 May 2021

    What to do if this error occurs SSRS error: There was an error while trying to deserialize parameter http://tempuri.org/:queryBuilderArgs. Restart these Windows Services : Microsoft Dynamics AX Object Server 6.0$  SQL Server Reporting Services  Go to Start and type Services Restart these services

    SSRS – sql server reporting services

  • D365FO – AX – Copy attachments from Project quotations (SalesQuotationTable) to new or existsing Project (ProjTable) while using “Transfer to project” functionality

    11 May 2021

    We want to copy attachments from Project quotation table to new or existsing project from “Transfer to project” functionality Create an extension of SalesQuotationProjLinkWizard class [ExtensionOf(classStr(SalesQuotationProjLinkWizard))] Create a final class final class Al0SalesQuotationProjLinkWizard_Extension { ………….. } Create “al0CopyAttachmentsQuotationToProject” custom method. This method retreieve attachments from SalesQuotationTable to ProjTable. Inside class create a Chain of Command…

    Attachments, X++

  • D365FO – AX – Update Data Entity Target Entity fields with X++

    7 May 2021

    Imagine you want to set the value of a field of the Target Entity of a Data Entity with X ++ code You have to create an extension class that extends the data Entity, extends “mapEntityToDataSource” method and add your code inside.

    Data Entities, Extensions, X++

  • D365FO – AX – Extends Data Entity method using Chain of Command

    7 May 2021

    Extending a data entity with Chain of Command is the same as extending a table. Create an extension class, use “ExtensionOf” attribute, call method and use Chain of command.

    Chain of Command, Extensions, X++

  • D365FO – AX – Work with data management in Finance and Operations apps

    6 May 2021

    You can export or import data in Finance and Operations apps by using the Data management workspace. Validate the data by staging the source data, and then move it to the target tables in the Finance and Operations apps database. Learning objectives In this module, you will learn how to: Identify the correct pattern for…

    Data management

  • D365FO – AX – Add new field to a Data Entity

    6 May 2021

    Open AOT and search for data entity (for example “PurchPurchaseOrderHeaderV2Entity”) Create an extension and add it to your project Search your field in the data source table Drag and drop your field from data source to Data Entity fields Open AOT and search for data entity staging table (for example “PurchPurchaseOrderHeaderV2Staging”) Create an extension and…

    X++

  • D365FO -AX – Remove spaces from Text in X++

    6 May 2021

    To Remove spaces from Text you can get idea from below code sample. Here we are update name fields which include spaces on right and left side .

    Trim, X++

  • D365FO – AX – How to add a Dialog text in a RunBase dialog with X++?

    5 May 2021

    THis code explains how to add a text in a Runbase dialog? This is the result :

    Forms, RunBase, RunBaseBatch, Simple Dialog, X++

  • D365FO – AX – How to get current system date in X++?

    5 May 2021

    systemDateGet();

    X++

  • D365FO – AX – Build workspaces in Finance and Operations apps

    3 May 2021

    Reference article : https://docs.microsoft.com/en-us/learn/modules/build-workspaces-finance-operations/ Design KPIs KPIs can be created in the developer environment and then embedded into workspaces to provide users with key measurable values that allow them to see how business is performing. The below image shows an example of a KPI tile in a workspace. KPIs should have clear objectives that are…

    AX – D365FFO, KPI, Workspaces

  • D365FO – AX – Synchronous and Asynchronous operations

    3 May 2021

    Reference article : https://community.dynamics.com/365/financeandoperations/b/sertansdynamicsax/posts/synchronous-and-asynchronous-operations-in-ax-7 In AX7 we have various new ways to execute a time consuming operation on the user client. We all know the feeling if we execute a very long operation on a program window that operation blocks all the user interface until it is completed. To prevent this, in AX 2012 we used either…

    Asynchronous operations, Synchronous operations, X++

  • D365FO – AX – X++ attribute classes

    3 May 2021

    Reference article : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/dev-ref/xpp-attribute-classes This topic describes the use of attributes in X++. An attribute is a non-abstract class that extends (inherits from) the SysAttribute class. Attributes represent or store metadata about types and methods. An attribute can be attached to a class, an interface, or a method of a class, interface, or table. Creating an attribute…

    Attributes, X++

  • D365FO – AX – What is the default AX 2012 username and password

    3 May 2021

    Userjname : Administrator Password : pass@word1 (The @ symbol must be written with combination of Alt+2 in English keyboard)

    AX – D365FFO

  • D365FO – AX – Posting a Transfer Order using X++

    30 April 2021

    While working with unit testing in AX, I came across the need to generate a transfer order and post it to generate the associated tables. I have used the FormLetter classes for posting Sales Orders & Purchase Orders in the past so I started looking for a similar process for Transfer Orders. I started by…

    Transfer orders, X++

  • D365FO – AX – Creating transfer order through X++ code

    29 April 2021

    To create a transfer oder via a code: inventTransferTable.clear();inventTransferTable.initValue();numberSequenceReference = InventParameters::numRefTransferId();numberSeq =numberSeq::newGetNumFromCode(numberSequenceReference.NumberSequence);inventTransferTable.TransferId = numberSeq.num();inventTransferTable.InventLocationIdFrom = fromloc;inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdFrom));inventTransferTable.InventLocationIdTo = toloc;inventTransferTable.modifiedField(fieldNum(InventTransferTable,InventLocationIdTo));inventTransferTable.TransferStatus = InventTransferStatus::Created;inventTransferTable.insert(); inventTransferLine.clear();inventTransferLine.initFromInventTransferTable(inventTransferTable,NoYes::Yes);nventTransferLine.ItemId = item;inventTransferLine.initFromInventTable(InventTable::find(item));inventTransferLine.QtyTransfer = qty_ship;inventTransferLine.QtyShipNow = 0;inventTransferLine.QtyReceiveNow = 0; inventTransferLine.QtyRemainReceive = qty_ship ; inventTransferLine.QtyRemainShip = qty_ship ; inventTransferLine.insert(); Also set the two fields:QtyRemainShip and QtyRemainReceive to the value of QtyTransfer when you create the line.

    Transfer orders, X++

  • D365FO – AX – How to use Map and MapEnumerator (X++)

    29 April 2021

    Similar to Set class, Map class allows you to associate one value (the key) with another value. Both the key and value can be any valid X++ type, including objects. The types of the key and the value are specified in the declaration of the map. The way in which maps are implemented means that…

    Map, X++

  • How to show text in a dialog form control

    23 April 2021

    protected Object dialog() { dialog = super(); dialogCheckMinQty = dialog.addField(extendedTypeStr(NoYesId), “Check minimum Qty”); dialogShowUsrDialog = dialog.addField(extendedTypeStr(NoYesId),“Pop-up message”); return dialog; }

    Forms, Simple Dialog, X++

  • How to add checkBox in Dialog and get value?

    23 April 2021

    Dialog dialog = new Dialog(“New dialog with checkBox”);NoYesId checkValue = NoYes::No;DialogField dialogField = dialog.addFieldValue(extendedTypeStr(NoYesId), checkValue, “Check it”);if (dialog.run()){ checkValue = dialogField.value(); info(strfmt(“Value %1” , checkValue));}

    Forms, Simple Dialog, X++

  • D365FO – AX – Check all changes made in an environment in AX2012

    22 April 2021

    System Administration, Version Control – TFS

  • D365FO – AX – SysTest Framework documentation

    20 April 2021

    SysTest Framework documentation Testing and validations : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/perf-test/testing-validation Test projects in Visual Studio : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/perf-test/testing-support Deploy and use a continuous build and test automation environment : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/perf-test/continuous-build-test-automation SysTest Filtering using class and method attributes : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/perf-test/systest-filtering

    SysTest Framework, Testing

  • SSRS – CREATING A REPORT BOUND TO A REPORT DATA PROVIDER CLASS (X++ BUSINESS LOGIC)

    20 April 2021

    In this walkthrough, you use a report data provider (RDP) class with business logic to process data and then display the outcome of the business logic on a report. An RDP class is an X++ class that is used to access and process data for a Reporting Services report. The options for a data source…

    Reports, SSRS – sql server reporting services

  • D365FO / AX – Set default model for new projects

    19 April 2021

    There is a config file under C:\Users\username\Documents\Visual Studio 2015\Settings\DefaultConfig.xml. Update: For Visual Studio 2017 and newer the path for this config file is C:\Users\Administrator\Documents\Visual Studio Dynamics 365\DynamicsDevConfig.xml Add the DefaultModelForNewProjects node with the name of the model to it:

    System Administration, Visual Studio, X++

  • D365FFO – AX – Simple List form pattern

    19 April 2021

    Reference article : https://docs.microsoft.com/en-us/dynamics365/fin-ops-core/dev-itpro/user-interface/simple-list-form-pattern This article provides information about the Simple List form pattern. This pattern is used to maintain data for simple entities. Usage The Simple List pattern is used to maintain data for simple entities. Simple entities are entities that have six or fewer fields and no parent/child relationships. There are some exceptions…

    Forms, Simple List, X++

  • D365FFO – AX – OPTIMISTIC CONCURRENCY CONTROL

    19 April 2021

    Optimistic Concurrency Control (OCC) helps increase database performance. Pessimistic Concurrency Control locks records as soon as they are fetched from the database for an update. However, Optimistic Concurrency only locks records from the time when the actual update is performed. Pessimistic concurrency was the only option available in Microsoft Axapta 3.0 (now a part of Microsoft…

    System Administration

  • D365FFO – AX – Runbase – Allow multiple selection in a Lookup dialogue field

    19 April 2021

    Reference article : https://vermaax.wordpress.com/2014/07/30/multi-value-select-for-lookup-in-dynamics-ax-2009/ DialogField dlgField = dialog.addField(…);FormStringControl fsc = dlgField.control();fsc.replaceOnLookup(false); Let’s assume we have lookup for a control If you put ReplaceOnLookup property to Yes (default), the control will not let you select more than one value. If you put ReplaceOnLookup property to No (default), the control will let you select more than one value.

    Forms, RunBase, RunBaseBatch, X++

  • D365FFO – AX – Apply firstonly using query class (QueryRun)

    16 April 2021

    example static void Job22(Args _args) {    Query q = new Query();    QueryBuildDataSource qbds = q.addDataSource(tablenum(CustTable  ));    qbds.firstOnly(true);    SysQuery::findOrCreateRange(qbds,fieldNum(CustTable,AccountNum)).value(‘fdfd’);    qbds.addOrderByField(fieldNum(CustTable,AccountNum),SortOrder::Descending); }

    FirstOnly, Query

  • D365FFO – AX – Enable FORUPDATE property in a QueryRun expression

    16 April 2021

    qbds.update(true);

    Query

  • D365FFO – AX – QueryBuildDataSource SortOrder syntax

    16 April 2021

    static void Cyborg3QueryBuild2(Args _args) { Query query; QueryRun qr; QueryBuildDataSource qbds; QueryBuildRange qbr; VendTable vendTable; query = new query(); qbds = query.addDataSource(tableNum(vendTable)); qbr = qbds.addRange(fieldNum(vendTable, VendGroup)); qbr.value(’10’); //here is the line where I thought I could control the sort direction qbds.addSortField(fieldNum(vendTable, AccountNum),SortOrder::Ascending); qr = new QueryRun(query); if(qr.prompt()) { while(qr.next()) { vendTable = qr.get(tableNum(vendTable)); info( vendTable.AccountNum);…

    Query, Query ranges, QueryBuildDataSource, Sort

  • D365FO – AX – Multiple tables join with Query AddLink syntax example

    16 April 2021

    This example : Query q = new query();QueryRun qr;QueryBuildDataSource qbds;QueryBuildDataSource qbds2;QueryBuildDataSource qbds3;QueryBuildRange qbr; qbds = q.addDataSource(tableNum(CustPackingSlipJour));qbr = qbds.addRange(fieldnum(CustPackingSlipJour, StatusExportDDTRhiagERA));qbr.value(QueryValue(NoYes::No));qbr = qbds.addRange(fieldnum(CustPackingSlipJour, ReturnItemNum));qbr.value(QueryValue(“”)); qbds3 = qbds.addDataSource(tableNum(EDIDocumentParametersERA));qbds3.relations(false);qbds3.joinMode(JoinMode::InnerJoin);qbds3.fetchmode(QueryFetchMode::One2One);qbds3.addLink(fieldnum(CustPackingSlipJour, OrderAccount),fieldnum(EDIDocumentParametersERA, CustAccount)); qbds2 = qbds.addDataSource(tableNum(InterfaceWMSParameterERA));qbds2.relations(false);qbds2.joinMode(JoinMode::InnerJoin);qbds2.fetchmode(QueryFetchMode::One2One);qbds2.addLink(fieldnum(CustPackingSlipJour, InventLocationId),fieldnum(InterfaceWMSParameterERA, IntInventLocationId));  qr = new QueryRun(q);   while (qr.next()) { //Insert code here } Produces this SQL output: SELECT *FROM CustPackingSlipJourWHERE (StatusExportDDTRhiagERA = 0 AND ReturnItemNum = ”)JOIN EDIDocumentParametersERAON…

    AddLink, Query, Query joins, Query ranges, QueryBuildDataSource, X++

  • D365FO – AX – How to add TWO links between two datasource in X++ Query

    16 April 2021

    Reference article : https://community.dynamics.com/ax/f/microsoft-dynamics-ax-forum/188732/how-to-add-two-links-between-two-datasource-in-x-query Here’s a job I just wrote. static void Job1(Args _args) { Query q; QueryBuildDataSource qbds; QueryBuildRange qbr; QueryRun qr; str value; InventJournalTrans inventJournalTrans; InventTransOrigin inventTransOrigin; ; q = new Query(); qbds = q.addDataSource(tableNum(InventJournalTable)); qbr = qbds.addRange(fieldNum(InventJournalTable, JournalType)); qbr.value(SysQuery::value(InventJournalType::Transfer)); qbds = qbds.addDataSource(tableNum(InventJournalTrans)); qbds.relations(true); qbds.fetchMode(QueryFetchMode::One2Many); qbds = qbds.addDataSource(tableNum(InventTransOrigin)); qbr = qbds.addRange(fieldNum(InventTransOrigin, InventTransId)); value…

    Query, Query joins, Query ranges

  • D365FFO – AX – How to set a Form to “read only” (disable a form)

    15 April 2021

    It’s not possible to disable all fields of a form, but you can disable all datasource fields contained in the form. Go to init() method of the form and set the AllowEdit of the data source to false Something like this public void  init() { CustVendExternalItem_ds.allowEdit(false); }

    Forms

  • D365FFO – AX – Where to find “External item description” Form

    15 April 2021

    Go in “Product information management” menu –> Common –> Released Product Click on “Purchase” tab –> External item description

    External item description

  • D365FFO – AX – Implement role-based security in Finance and Operations apps

    15 April 2021

    Reference article : https://docs.microsoft.com/it-it/learn/modules/role-security-finance-operations/ With role-based security, access to Finance and Operations apps is not granted to individual users, but to security roles to which users are assigned. A user who is assigned to a security role has access to the set of privileges that is associated with that role. If a user isn’t assigned…

    Security Policy

  • D365FO – AX – Cache Lookup Property of table

    15 April 2021

    Caches are used on both the client and the server. It increases the performance, the ax will get data from the cache instead of doing round trips and DB calls. So for each table, it’s good to use cache lookup property. Microsoft Dynamics Ax runtime manages the cache by removing old records when new records are…

    Table caching, Tables

  • D365FFO – AX – SINGLE-RECORD CACHING

    14 April 2021

    Record caching is enabled for a table when all the following statements are true: The CacheLookup property on the table is enabled by setting it to one of the following values: NotInTTS, Found, FoundAndEmpty. The record buffer disableCache method has not been called with a parameter of true. Records are cached for all unique indexes when all the following criteria…

    Table caching, Tables

  • D365FFO – AX – SET-BASED CACHING

    14 April 2021

    In Microsoft Dynamics AX, groups of records can be cached all at once with set-based caching. Set-based caching can be implemented in two ways: At design time, by setting the table’s CacheLookup property to EntireTable. In code, by using the RecordViewCache class. EntireTable Cache When you set a table’s CacheLookup property to EntireTable, all the…

    Table caching, Tables

  • D365FFO – AX – Create a security policy

    14 April 2021

    This topic explains how to create a simple security policy that secures access to customers and customer groups, based on a range for a customer group. Add a new query In Visual Studio, add a new query, such as XDSQCustGroup10, to your project/solution. The query will be used to restrict data access from the Constraint table. Right-click Data…

    Security Policy

  • D365FFO – AX – PERFORMANCE TIMER

    14 April 2021

    This topic provides an overview of the Performance timer, which is a tool that helps you to determine why your system’s performance might be slow. To open the Performance timer, open your webpage with the added parameter debug=develop: https://yoursite.cloud.test.dynamics.com/en/?cmp=USMF&debug=develop Note: When you run in debug mode you will notice slower performance. You can quickly get…

    Performance timer, System Administration

  • D365FFO – AX – Enable change tracking for entities

    14 April 2021

    Change tracking enables incremental export of data from Finance and Operations apps by using Data management. In an incremental export, only records that have changed are exported. To enable incremental export, you must enable change tracking on entities. If you don’t enable change tracking on an entity, you can only enable a full export each…

    Change tracking, Data Entities, Data management

←Previous Page Next 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