Quantcast
Channel: Dynamics AX 2012 Data Import using Excel Add-in
Viewing all 41 articles
Browse latest View live

Microsoft Dynamics AX 2012 Excel Add-in – Questions and Answers (Defaulting Logic)

$
0
0
Microsoft Dynamics AX 2012
Excel Add-in – Questions and Answers (Defaulting Logic)
 
Purpose: The purpose of this document is to provide answers to frequently asked questions related to Microsoft Dynamics AX 2012 Excel Add-in.
 
Question: How does Microsoft Dynamics AX 2012 Excel Add-in implement defaulting logic?
 
Answer: The way the system implements defaulting logic in Excel Add-in varies depending on AIF proxy classes implementation for particular business entities. In this document to illustrate main concepts I will use General journal (LedgerJournalTable) - Description and Sales order (SalesTable) - Pool business entities fields in Microsoft Dynamics AX 2012.
 
Details
 
LedgerJournalTable and SalesTable Tables in Microsoft Dynamics AX 2012 have corresponding AxLedgerJournalTable and AxSalesTable AIF Proxy classes. All AIF Proxy classes extend AxInternalBase class. AxInternalBase class in its turn implements some core methods related to data manipulation.
One of core methods in AxInternalBase class is doSave method. Focusing on Defaulting Logic in this investigation we'll take a closer look at setTableFields method where the assignment of default values for fields usually happens.  
 
General journal – Description
 
Rich Client
 
Out-of-the-box in Rich Client once you specify Journal name on General journal header Description is populated from Journal name automatically
 
 
This is triggered in modified method of Form Data Source
 
Forms\LedgerJournalTable\Data Sources\LedgerJournalTable\Fields\JournalName\Methods\modified
 
Here's how Description is defined for Journal name
 
 
The principal difference between Rich Client and Excel Add-in is that in Rich Client some code is executed on the client which allows for interactive data manipulation (stateful behavior) and Excel Add-in will have to go through formal AIF interface every time the data is published into Microsoft Dynamics AX 2012 (stateless behavior). Please note that when you deal with Form in Rich Client you already deal with predefined dataset as opposite to Excel Add-in where you have to define your dataset first. That's why in Rich Client it's possible to trigger defaulting logic from Form interactively. For example, when new record is created on Form Data source initValue method on respective Data source (and Table) will be executed, or when field value is modified on the Form the system will execute modified method on Data source field (and modifiedField method on Table).
 
Excel Add-in
 
If you explicitly provide the value of Description before publishing data in Excel Add-in the system will take this value into account. By other words explicitly provided value overrides default value from Journal name 
 
Before publishing
 
After publishing
 
What if I don't specify Description?
 
If you don't provide a value of Description before publishing data in Excel Add-in it will still be populated from Journal name. Please note that you will see populated value of Description in Excel Add-in only after successful publishing 
 
Before publishing
 
After publishing
 
In Microsoft Dynamics AX 2012 LedgerJournalTableType class represents Ledger journal business entity of different types. LedgerJournalTableType class is equipped with number of methods in order to populate default values for certain fields including Description (LedgerJournalTable.Name)
 
Field name
Method name
JournalNum
defaultJournalNum
Name
defaultName
NumberSequenceId
defaultNumberSequenceId
JournalType
defaultJournalType
PaymentGenerated_IT
defaultPaymentGenerated_IT
OffsetAccount
defaultOffsetAccount
PostedDateTime
defaultPostedDateTime
OffsetAccountType
defaultOffsetAccountType
GroupBlockId
defaultGroupBlockId
Dimension
defaultDimension
CurrencyCode
defaultCurrencyCode
FixedExchRate
defaultFixedExchRate
DetailSummaryPosting
defaultDetailSummaryPosting
DocumentNum
defaultDocumentNum
ExchRateSecondary
defaultExchRateSecondary
ExchRate
defaultExchRate
FixedOffsetAccount
defaultFixedOffsetAccount
RemoveLineAfterPosting
defaultRemoveLineAfterPosting
CurrentOperationsTax
defaultCurrentOperationsTax
LedgerJournalInclTax
defaultLedgerJournalInclTax
BankRemittanceType
defaultBankRemittanceType
CustVendNegInstProtestProcess
defaultCustVendNegInstProtestProcess
VoucherAllocatedAtPosting
defaultVoucherAllocatedAtPosting
LinesLimitBeforeDistribution
defaultLinesLimitBeforeDistribution
WorkflowApprovalStatus
defaultWorkflowApprovalStatus
 
Default value of Description is populated in defaultName method
 
Classes\LedgerJournalTableType\defaultName
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\LedgerJournalTableType\defaultName
<![if !supportLists]>-          <![endif]>Classes\LedgerJournalTableType\defaultRow
<![if !supportLists]>-          <![endif]>Classes\AxLedgerJournalTable\defaultRow
<![if !supportLists]>-          <![endif]>Classes\AxLedgerJournalTable\setTableFields
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\doSave
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\save
<![if !supportLists]>-          <![endif]>…
 
Please note that there's also defaulting logic related to Description in insert method in LedgerJournalTable Table which covers other functional scenarios
 
Tables\LedgerJournalTable\Methods\insert
  
Sales order – Pool
 
Rich Client
 
Out-of-the-box in Rich Client once you create Sales order header on Create Sales order form the system will populate Sales Pool ID right away
 
 
Please note that Pool is populated based on Default Pool from Parameters even before particular Customer account is selected
 
 
This is triggered from Form Data source initValue method which will eventually call initValue method on SalesTableType class
 
Once Customer account is selected the system will populate Pool based on Customer settings
 
 
This is triggered from Form Data source modified method which will eventually call modifiedField method on SalesTableType class
 
 
Excel Add-in
 
If you explicitly provide the value of Pool before publishing data in Excel Add-in the system will take this value into account. By other words explicitly provided value overrides default value from Customer (or Parameters)
 
Before publishing
 
After publishing
 
What if I don't specify Pool?
 
If you don't provide a value of Pool before publishing data in Excel Add-in it will still be populated from Customer (or Parameters). Please note that you will see populated value of Pool in Excel Add-in only after successful publishing 
 
Before publishing
 
After publishing
 
In Microsoft Dynamics AX 2012 SalesTableType class represents Sales order business entity of different types. SalesTableType class is equipped with number of methods in order to set values for certain fields including Pool (SalesTable.SalesPoolId)
 
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxSalesTable\setSalesPoolId
<![if !supportLists]>-          <![endif]>Classes\AxSalesTable\setTableFields
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\doSave
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\save
 
Please note that what was done in 2 steps in Rich Client (Default Pool populated from Parameters and then Pool populated from Customer) on Create Sales order form is executed as 1 step in Excel Add-in when the data is published through AIF interface.
 
Version: Microsoft Dynamics AX 2012 R2
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Question, Answer, Defaulting Logic.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.
 
Author: Alex Anikiev, PhD, MCP

Microsoft Dynamics AX 2012 Excel Add-in – Questions and Answers (Depending Fields)

$
0
0
Microsoft Dynamics AX 2012
Excel Add-in – Questions and Answers (Depending Fields)
 
Purpose: The purpose of this document is to provide answers to frequently asked questions related to Microsoft Dynamics AX 2012 Excel Add-in.
 
Question: How does Microsoft Dynamics AX 2012 Excel Add-in deal with Dependent fields?
 
Answer: The way the system implements Depending fields logic in Excel Add-in varies depending on AIF proxy classes implementation for particular business entities. In this document to illustrate main concepts I will use Sales order (SalesTable/SalesLine), Purchase order (PurchTable/PurchLine) and Free Text Invoice (CustInvoiceTable/CustInvoiceLine) business entities in Microsoft Dynamics AX 2012.
 
Details
 
SalesTable/SalesLine, PurchTable/PurchLine and CustInvoiceTable/CustInvoiceLine Tables in Microsoft Dynamics AX 2012 have corresponding AxSalesTable/AxSalesLine, AxPurchTable/AxPurchLine and AxCustInvoiceTable/AxCustInvoiceLine AIF Proxy classes. All AIF Proxy classes extend AxInternalBase class. AxInternalBase class in its turn implements some core methods related to data manipulation.
One of core methods in AxInternalBase class is save method. Focusing on Dependent fields in this investigation we'll take a closer look at valueMapDependentFields method where Dependent fields logic is usually implemented.
 
 
Sales order – Sales line and Purchase order – Purchase line
 
Data Model
 
<![if !vml]><![endif]>
 
In Microsoft Dynamics AX 2012 the combination of inventory dimensions is represented by InventDimId field which references to InventDim Table. Thus SalesLine and PurchLine Tables have InventDimId field which is the foreign key pointing to InventDim Table.
 
Rich Client
 
Out-of-the-box in Rich Client once you save Sales order line InventDimId field is populated automatically
 
 
For Sales order line this is triggered in write method of Form Data Source
 
Forms\SalesTable\Data Sources\SalesLine\Methods\write
 
Similarly once you save Purchase order line InventDimId field is populated automatically
 
 
For Purchase order line this is triggered in write method of Form Data Source
 
Forms\PurchTable\Data Sources\PurchLine\Methods\write
 
The principal difference between Rich Client and Excel Add-in is that in Rich Client some code is executed on the client which allows for interactive data manipulation (stateful behavior) and Excel Add-in will have to go through formal AIF interface every time the data is published into Microsoft Dynamics AX 2012 (stateless behavior). Please note that when you deal with Form in Rich Client you already deal with predefined dataset as opposite to Excel Add-in where you have to define your dataset first. That's why in Rich Client it's possible to trigger Dependent fields logic from Form interactively. For example, when the record is saved on Form Data source write method on respective Data source (and insert or update methods on Table) will be executed.
 
Excel Add-in
 
Sales line – Inventory dimensions
 
Purchase line – Inventory dimensions
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxSalesLine\valueMapDependingFields (Classes\AxPurchLine\valueMapDependingFields)
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\save
 
Please note that as soon as Excel Add-in uses formal AIF interface InventDimId field on corresponding Table will be populated when you publish data into Microsoft Dynamics AX 2012.
 
Free text Invoice – Free text Invoice line
 
Data Model
 
<![if !vml]><![endif]>
 
In Microsoft Dynamics AX 2012 State is dependent on Country. Thus for CustInvoiceLine Table which has both OrigCountryRegionId and OrigState fields the system can assign State only if it belongs to specified Country.
 
Rich Client
 
Out-of-the-box in Rich Client once you specify Country on Free Text invoice line the system will provide lookup for State with the list of States which belong to selected Country
 
 
State lookup behavior is dictated by Table Relationship between CustInvoiceLine and LogisticsAddressState Tables
 
Please note that if you try to key in State without Country specified you will see the following warning
 
This means that in order to select State you have to specify Country
 
Excel Add-in
 
Free Text invoice line – Country/State
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxCustInvoiceLine\valueMapDependingFields
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\save
 
Please note that Dependent fields logic will be executed before doSave method of AxInternalBase class with all AIF proxy classes processing logic. In this particular case Country has to be specified in order for the system to accept State specified. Both values will have to be specified for successful publishing of Origin information (Foreign trade) into Microsoft Dynamics AX 2012.
 
Version: Microsoft Dynamics AX 2012 R2
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Question, Answer, Dependent Fields.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.
 
Author: Alex Anikiev, PhD, MCP

Microsoft Dynamics AX 2012 Excel Add-in – Questions and Answers (Related Records)

$
0
0
Microsoft Dynamics AX 2012
Excel Add-in – Questions and Answers (Related Records)
 
Purpose: The purpose of this document is to provide answers to frequently asked questions related to Microsoft Dynamics AX 2012 Excel Add-in.
 
Question: How does Microsoft Dynamics AX 2012 Excel Add-in deal with Related Records?
 
Answer: The way the system implements Related records logic in Excel Add-in varies depending on AIF proxy classes implementation for particular business entities. In this document to illustrate main concepts I will use Sales order (SalesTable/SalesLine) and Purchase order (PurchTable/PurchLine) business entities in Microsoft Dynamics AX 2012.
 
Details
 
SalesTable/SalesLine and PurchTable/PurchLine Tables in Microsoft Dynamics AX 2012 have corresponding AxSalesTable/AxSalesLine and AxPurchTable/AxPurchLine AIF Proxy classes. All AIF Proxy classes extend AxInternalBase class. AxInternalBase class in its turn implements some core methods related to data manipulation. One of core methods in AxInternalBase class is doSave method. Focusing on Related records in this investigation we'll take a closer look at createOrUpdateRelatedRecords method where Related records logic is usually implemented.
 
 
Sales order – Sales line and Purchase order – Purchase line
 
Data Model
 
<![if !vml]><![endif]>
 
In Microsoft Dynamics AX 2012 you can add Miscellaneous charges to Sales order/line and Purchase order/line. MarkupTrans Table contains all types of Miscellaneous charges transactions and references to the original document by TableID/RecID (TransTableID/TransRecID).
 
Rich Client
 
Out-of-the-box in Rich Client once you change Charges group on Sales order MarkupTrans record(s) may be automatically populated based on predefined rules (Automatic charges)
 
 
This is triggered in update method of SalesTableType class
 
Classes\SalesTableType\Methods\update
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\Markup\insertMarkupTrans
<![if !supportLists]>-          <![endif]>Tables\SalesTable\Methods\createMarkupTrans
<![if !supportLists]>-          <![endif]>Classes\SalesTableType\Methods\update
<![if !supportLists]>-          <![endif]>Tables\SalesTable\Methods\update
<![if !supportLists]>-          <![endif]>Forms\SalesTable\Data Sources\SalesTable\Methods\update
 
The principal difference between Rich Client and Excel Add-in is that in Rich Client some code is executed on the client which allows for interactive data manipulation (stateful behavior) and Excel Add-in will have to go through formal AIF interface every time the data is published into Microsoft Dynamics AX 2012 (stateless behavior). Please note that when you deal with Form in Rich Client you already deal with predefined dataset as opposite to Excel Add-in where you have to define your dataset first. That's why in Rich Client it's possible to trigger Related records logic from Form interactively. For example, when the record is changed on Form Data source update method on respective Data source (and update methods on Table) will be executed.
 
Excel Add-in
 
Sales line – Miscellaneous charges
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxSalesLine\createOrUpdateRelatedRecords
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\doSave
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\save
 
Please note that as soon as Excel Add-in uses formal AIF interface Related records will be populated when you publish data into Microsoft Dynamics AX 2012.
 
Purchase order – Purchase line
 
Rich Client
 
Similarly once you change Charges group on Purchase order MarkupTrans record(s) may be automatically populated based on predefined rules (Automatic charges)
 
 
This is triggered in update method of PurchTableType class
 
Classes\PurchTableType\Methods\update
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\Markup\insertMarkupTrans
<![if !supportLists]>-          <![endif]>Tables\PurchTable\Methods\createMarkupTrans
<![if !supportLists]>-          <![endif]>Classes\PurchTableType\Methods\update
<![if !supportLists]>-          <![endif]>Tables\PurchTable\Methods\update
<![if !supportLists]>-          <![endif]>Forms\PurchTable\Data Sources\PurchTable\Methods\update
 
Excel Add-in
 
Purchase line – Miscellaneous charges
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxPurchLine\createOrUpdateRelatedRecords
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\doSave
<![if !supportLists]>-          <![endif]>Classes\AxInternalBase\save
 
Please note that Related records logic will be executed after Defaulting logic when data is published into Microsoft Dynamics AX 2012 through AIF interface.
 
Version: Microsoft Dynamics AX 2012 R2
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Question, Answer, Related Records.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.
 
Author: Alex Anikiev, PhD, MCP

Microsoft Dynamics AX 2012 Excel Add-in – Questions and Answers (Validation Logic)

$
0
0
Microsoft Dynamics AX 2012
Excel Add-in – Questions and Answers (Validation Logic)
 
Purpose: The purpose of this document is to provide answers to frequently asked questions related to Microsoft Dynamics AX 2012 Excel Add-in.
 
Question: How does Microsoft Dynamics AX 2012 Excel Add-in implement Validation Logic?
 
Answer: The way the system implements Validation logic in Excel Add-in varies depending on AIF proxy classes implementation for particular business entities. In this document to illustrate main concepts I will use General journal (LedgerJournalTrans) business entity in Microsoft Dynamics AX 2012. Also some special controls for interactive validation are provided in Excel Add-in for certain types of information, for example, financial dimensions combinations.
 
Details
 
LedgerJournalTrans Table in Microsoft Dynamics AX 2012 has corresponding AxLedgerJournalTrans AIF Proxy class. All AIF Proxy classes extend AxInternalBase class. AxInternalBase class in its turn implements some core methods related to data manipulation. One of core methods in AxInternalBase class is doSave method. Focusing on Validation logic in this investigation we'll take a closer look at validateFields and validateWrite methods where Validation logic is usually implemented.
 
General journal
 
Rich Client
 
Out-of-the-box in Rich Client on a Form when you change the value for certain field and move the focus to another field the system does auto-save of record and at this time the validation is performed
 
For example, if Currency value is changed on General journal line the system may throw validation error
 
In this particular case X++ validation logic was executed and as the result the user will see the following error
 
Call stack:
<![if !supportLists]>-          <![endif]>Classes\LedgerJournalEngine\currencyModified
<![if !supportLists]>-          <![endif]>Forms\LedgerJournalTrandDaily\Data Sources\LedgerJournalTrans\Fields\CurrencyCode\Methods\modified
 
In some cases validation errors may be caused by data model itself and not X++ validation logic
 
"The currency ALX does not exist" was caused by Relation between Currency and LedgerJournalTrans Tables
 
Tables\LedgerJournalTrans\Relations\Currency
 
X++ validation logic related to LedgerJournalTrans Table can be found in validateField and validateWrite method. validateField is executed when any field is changed and validateWrite method is executed for the entire record upon save 
 
Tables\LedgerJournalTrans\Methods\validateField
 
Tables\LedgerJournalTrans\Methods\validateWrite (validateWrite_Server)
 
Call Stack:
<![if !supportLists]>-          <![endif]>Tables\LedgerJournalTrans\ Methods\validateWrite
<![if !supportLists]>-          <![endif]>Forms\LedgerJournalTransDaily\Data Sources\LedgerJournalTrans\Methods\validateWrite
<![if !supportLists]>-          <![endif]>Forms\LedgerJournalTransDaily\Data Sources\LedgerJournalTrans\ Methods\leaveRecord
 
The principal difference between Rich Client and Excel Add-in is that in Rich Client some code is executed on the client which allows for interactive data validation (stateful behavior) and Excel Add-in will have to go through formal AIF interface every time the data is published into Microsoft Dynamics AX 2012 (stateless behavior). Please note that when you deal with Form in Rich Client you already deal with predefined dataset as opposite to Excel Add-in where you have to define your dataset first. That's why in Rich Client it's possible to execute Validation logic from Form interactively.
 
Excel Add-in
 
AxLedgerJournalTrans AIF Proxy class implements Validation logic in validateField and validateWrite methods
 
Classes\AxLedgerJournalTrans\Methods\validateField
 
Classes\AxLedgerJournalTrans\Methods\validateWrite
 
Please note that validateField and validateWrite methods in AxLedgerJournalTrans AIF Proxy class will eventually trigger validateField and validateWrite methods in LedgerJournalTrans Table
 
Currently out-of-the-box in Microsoft Dynamics AX 2012 R2 (September CTP) LedgerGeneralJournalService Web Service and LedgerJournalTrans Table can't be used due to error shown below
 
General journal – Add Data (LedgerGeneralJournalService)
 
General journal – Add Tables (LedgerJournalTrans)
 
That's why for the sake of General journal Validation logic demo I'll use Microsoft Dynamics AX 2012 FPK
 
Example of X++ validation logic error
 
Before publishing
 
After publishing
 
Example of data model validation logic error
 
Before publishing
 
After publishing
 
Excel Add-in also provides special controls for interactive validation for certain types of information. For example, financial dimension combination may be validated using "Select dimension attribute values" control
 
 
 
Please note that Segmented control in Rich Client shows different value lookup (Ledger account, Vendor, Customer, etc} depending of Account type = {Ledger, Vendor, Customer, etc}, however corresponding "Select dimension attribute values" control in Excel Add-in is only tailored for Ledger accounts 
 
Versions: Microsoft Dynamics AX 2012 R2, Microsoft Dynamics AX 2012 FPK
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Question, Answer, Validation Logic.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.
 
Author: Alex Anikiev, PhD, MCP

Microsoft Dynamics AX 2012 Excel Add-in – Questions and Answers (Business Logic)

$
0
0
Microsoft Dynamics AX 2012
Excel Add-in – Questions and Answers (Business Logic)
 
Purpose: The purpose of this document is to provide answers to frequently asked questions related to Microsoft Dynamics AX 2012 Excel Add-in.
 
Question: How can I execute additional business logic using Microsoft Dynamics AX 2012 Excel Add-in?
 
Answer: Microsoft Dynamics AX 2012 Excel Add-in uses AIF Web Services for publishing the data into Microsoft Dynamics AX 2012. In order to automate certain processes or execute additional business logic you can override updateNow method in appropriate AIF Document class and implement necessary business logic in X++. In this document to illustrate main concepts I will use General journal (LedgerGeneralJournalService) and Customer Payment journal (LedgerCustPaymJournalService) Web Services in Microsoft Dynamics AX 2012.
 
Details
 
Every AIF Web Service has corresponding Document class in AOT, usually these classes are prefixed with Axd. For example, General journal Web Service Document class is AxdLedgerGeneralJournal class and Customer Payment journal Web Service Document class is AxdCustPaymJournal class. Focusing on Business Logic aspect in this investigation we'll take a closer look at Framework classes implementing create and update operations.
 
Classes\AxdBaseCreate\Methods\deserializeDocument
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxdBase\Methods\updateNow
<![if !supportLists]>-          <![endif]>Classes\AxdBaseUpdate\Methods\postProcessDocument
<![if !supportLists]>-          <![endif]>Classes\AxdBaseUpdate\Methods\deserializeDocument
<![if !supportLists]>-          <![endif]>Classes\AxdBaseCreate\Methods\createDocumentList
<![if !supportLists]>-          <![endif]>Classes\AxdBase\Methods\createList
<![if !supportLists]>-          <![endif]>Classes\AifDocumentService\Methods\createList
 
Classes\AxdBaseUpdate\Methods\postProcessDocument
 
Call Stack:
<![if !supportLists]>-          <![endif]>Classes\AxdBase\Methods\updateNow
<![if !supportLists]>-          <![endif]>Classes\AxdBaseUpdate\Methods\postProcessDocument
<![if !supportLists]>-          <![endif]>Classes\AxdBaseUpdate\Methods\deserializeDocument
<![if !supportLists]>-          <![endif]>Classes\AxdBaseUpdate\Methods\updateDocumentList
<![if !supportLists]>-          <![endif]>Classes\AxdBase\Methods\updateList
<![if !supportLists]>-          <![endif]>Classes\AifDocumentService\Methods\updateList
 
updateNow method in Document class will be executed as a last step (post-processing) after AIF message processing which allows you to execute additional business logic
 
For example, after General journal will be created or updated via General journal Web Service certain fields such as Journal balance, etc will be updated
 
Classes\AxdLedgerGeneralJournal\Methods\updateNow
 
For comparison in Rich Client when you post General journal Journal balance update is triggered from Form in "Validate" (and "Post") button clicked method
 
Forms\LedgerJournalTransDaily\Designs\DesignList\ButtonCheckJournal\Methods\clicked
 
Another example is Customer Payment journal when after its creation or update in certain scenarios it may be necessary to generate Settlements against Customer invoices
 
Classes\AxdCustPaymJournal\Methods\updateNow
 
Typical requirement for automation is when you need to automatically post General journal after its successful creation. Please see below how you can implement this requirement in Microsoft Dynamics AX 2012
 
LedgerJournalPost::postJournal(LedgerJournalTable, false);
 
Classes\AxdLedgerGeneralJournal\Methods\updateNow
 
If you face with this requirement I'd also recommend introducing dedicated parameter in UI to control whether it's required or not to automatically post General journal when General journal AIF Web Service is invoked
 
Once you change necessary Document class please generate CIL because all AIF Web Services related code in Microsoft Dynamics AX 2012 is executed in CIL on the server
 
Please also note that if you use Tables (Add Tables) in Microsoft Dynamics AX 2012 Excel Add-in the system will use Generic Document Web Service at the back-end
 
Version: Microsoft Dynamics AX 2012 R2
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Question, Answer, Business Logic.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.
 
Author: Alex Anikiev, PhD, MCP

Dynamics AX 2012 Excel Add-in - Issues and Solutions (Method UpdateRecIdVisibility not found)

$
0
0
Dynamics AX 2012 Excel Add-in – Issues and Solutions (Method not found: ‘Void Microsoft.Dynamics.AX.Framework.OfficeAddin.DataSourceContainer.UpdateRecIdVisibility(Boolean))
Purpose: The purpose of this document is to outline some issues you may encounter when using Dynamics AX 2012 Excel Add-in for import of data and provide solutions to resolve them.
 
Issue: ‘Method not found: ‘Void Microsoft.Dynamics.AX.Framework.OfficeAddin.DataSourceContainer.UpdateRecIdVisibility(Boolean)’
 
Reason: After you initially install Microsoft Dynamics AX 2012 R2 Office Add-ins and then install Microsoft Dynamics AX 2012 R2 CU1 the old Microsoft Dynamics AX 2012 R2 DLLs related to Office Add-ins may still be present in the file system. The system uses old Microsoft Dynamics AX 2012 R2 DLLs related to Office Add-ins DLLs which causes this issue
 
Dynamics AX Error
 
For example, on the latest (as of today, April 24, 2013) Microsoft Dynamics AX 2012 R2 CU1 Demo VM this error occurs when you launch Excel 2013, define connection Options and then try to Add Table or Add Data  
 
Please note that Microsoft Dynamics AX 212 R2 CU1 build number is 6.2.1000.156
 
In fact if you look for UpdateRecIdVisibility method in Microsoft Dynamics AX 2012 R2 CU1 Microsoft.Dynamics.AX.Framework.OfficeAddin.dll assembly you will be able to find it there
 
So the real problem is in the fact that the system uses old Microsoft Dynamics AX 2012 R2 Microsoft.Dynamics.AX.Framework.OfficeAddin.dll assembly instead of new one
 
Please note that Microsoft Dynamics AX 212 R2 build number is 6.2.158.0
 
And if you check the version of Microsoft.Dynamics.AX.Framework.OfficeAddin.dll assembly
 
in C:\Windows\Microsoft.NET\assembly\GAC_MSIL folder
 
You will see that it’s 6.2.158.0 which corresponds to Microsoft Dynamics AX 2012 R2
 
Solution: Please delete highlighted above Microsoft.Dynamics.AX.Framework.Office.Addin folders in C:\Windows\Microsoft.NET\assembly\GAC_MSIL folder to get rid of old versions of DLLs   
 
If you get a message that Microsoft.Dynamics.AX.Framework.Office.Addin.dll is being used by another process when you try to delete it, please stop Microsoft Dynamics AX AOS and try again
 
Result: As the result you will be able to Add Tables and Add Data in Excel workbook
 
Options
 
Add Tables
 
Field Chooser
 
Specials Thanks is for Chris and Jason for helping to resolve this issue
Please check out Chris’ blog for more interesting articles here:http://blogs.msdn.com/b/chrisgarty/
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Issue, Problem, Solution, Resolution.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.
 
Author: Alex Anikiev, PhD, MCP
 
 

Microsoft Dynamics AX 2012 Excel Add-in – Security Roles (Add Tables, Add Data)

$
0
0
Microsoft Dynamics AX 2012 Excel Add-in – Security Roles (Add Tables, Add Data)
 
Purpose: The purpose of this document is to explain security settings required by Microsoft Dynamics AX 2012 Excel Add-in for data import/export using "Add Tables" and "Add Data" methods.
 
Challenge: When using Microsoft Dynamics AX 2012 Excel Add-in you have 2 methods to access data using "Add Tables" and "Add Data" functions. "Add Tables" function allows you to access raw tables (as they are listed in AOT). "Add Data" function allows you to access Services, standard Queries (Query references) and Custom Queries exposed through Document Data Sources in Organization Administration > Setup > Document Management. The challenge is how to set up security settings for Microsoft Dynamics AX 2012 Excel Add-in following required minimum privilege principle to allow users import/export data. 
 
Solution: Whenusing "Add Tables" function the system will access raw tables (as they are listed in AOT) and thus the user should be assigned to System Administrator role in order to import/export data. When using "Add Data" function the system will access the list of Document Data Sources to provide the user with the access to business data in accordance with his/her permissions. In order to use "Add Data" function the user does NOT need to be assigned to System Administrator role, instead you can leverage a very granular security setup to allow the user to import/export business data exposed through Document Data Sources, for example, only using certain operations preventing business data damage which may occur when using raw tables approach.  
 
Walkthrough
 
Whenusing "Add Tables" function the system will access raw tables (as they are listed in AOT).
 
Select Tables
 
 
In Microsoft Dynamics AX 2012 by default and by design only System Administrators have access to AOT.
 
Recommendation
Description
Always assign the least permissions when you set up and configure the user security features in Microsoft Dynamics AX.
Before you set up and configure the least permissions in Microsoft Dynamics AX, consider the following recommendations:
  • By default, and by design, only Microsoft Dynamics AX system administrators have access to the Application Object Tree (AOT). Do not grant users access to the AOT, unless the users are members of a development role who must access the AOT as part of their job requirements. If you grant regular users access to the AOT, the users may intentionally or unintentionally compile the application, synchronize the application, change license files, or change module configurations. All of these actions can cause problems in your business or organization.
  • Do not make users members of the System administrators role, or grant these users access to System administration in Microsoft Dynamics AX, unless the users are responsible for setting up and configuring Microsoft Dynamics AX in your business or organization. If you grant regular users access to this group and module, the users may intentionally or unintentionally cause problems in the Microsoft Dynamics AX application.
  • Do not assign users to the Windows Administrators group or Power Users group on their local computers, unless the users are explicitly required to perform the job functions of an administrator or power user. Members of these groups can add applications to their local computers and remove applications from their local computers, and these actions can introduce security risks. Instead, assign users to the Windows User group. Click Start > Administrative Tools > Server Manager > Local Users and Groups.
 
Please find more info about Security Best Practices in AX 2012 here:  http://technet.microsoft.com/en-us/library/hh202063.aspx
 
When the user invokes "Add Tables" or "Add Data" functions in Microsoft Dynamics AX 2012 Excel Add-in the system will use AifUserSessionService AIF Web Service to retrieve info about current user session
 
[SysEntryPointAttribute]
public AifUserSessionInfo getUserSessionInfo()
{
    AifUserSessionInfo info = new AifUserSessionInfo();
 
    info.parmAXLanguage(this.getLanguage());
    info.parmCurrencyInfo(this.getAifCurrencyInfo());
    info.parmCompany(this.getCompany());
    info.parmCompanyTimeZone(this.getCompanyTimeZone());
    info.parmUserPreferredTimeZone(this.getUserPreferredTimeZone());
    info.parmUserPreferredCalendar(this.getUserPreferredCalendar());
    info.parmUserId(this.getUserId());
    info.parmIsSysAdmin(Global::isSystemAdministrator());
    info.parmAOSLocaleName(AifUserSessionService::getAosLocaleName());
 
    return info;
}
 
Please note that an instance of AifUserSessionInfo class will have UserId and IsSysAdmin properties assigned to be consumed in External code (Excel Add-in). IsSysAdmin property signifies that the current user is assigned to System Administrator role, and in case IsSysAdmin property is set to "true" the user will have access "Add Tables"– "Select Tables" screen regardless of what actual UserId value is passed ("Admin" or not). And vice versa even if UserId = "Admin" value is passed, but IsSysAdmin property is not set the user will not have access to "Add Tables"– "Select Tables" screen and "The role you are assigned does not have permissions to access the selected data" error will appear.
 
When using "Add Data" function the system will access the list of Document Data Sources to provide the user with the access to business data in accordance with his/her permissions. Please consider using "Add Data" function for business data import/export which does NOT require your user to be assigned to System Administrator role.
 
To illustrate a necessary security setup for Microsoft Dynamics AX 2012 Excel Add-in when using "Add Data" approach I'll use User KEN for import of Ledger transactions via LedgerGeneralJournalService AIF Web Service
 
Please note that LedgerGeneralJournalService AIF Web Service is exposed and activated in Document Data Sources as shown below
 
Document Data Sources
 
 
This is security settings in Microsoft Dynamics AX 2012 for User KEN. Please note that User KEN is NOT assigned to System Administrator role
 
User KEN (Financial controller)
 
 
Now if I try to invoke "Add Tables" function the following error pops up
 
Dynamics AX Error
 
 
Please note that User KEN is NOT assigned to System Administrator role
 
Now instead of "Add Tables" I'm going to invoke "Add Data" function and select LedgerGeneralJournalService AIF Web Service
 
In the case your User doesn't have access to the business data based on tables in the query used by AIF Web Service you could see "User is not authorized to select a record in table" error
 
Microsoft Dynamics AX Office Addin  
 
 
In this particular case I used User TONY who doesn't have access to the required business data. You can easily fix it by assigning TONY to the role which has access to the required business data
In fact User KEN already has access to the required business data, so I'm going to invoke "Add Data" function now
 
Add Data
 
 
LedgerGeneralJournalService AIF Web Service shows up in the list of available Document Data Sources now. Please make sure you deploy appropriate Service group in order for Services to show up in the list
 
For example, on Microsoft Dynamics AX 2012 Demo VM I had to deploy LedgerServices Services group
 
Service group
 
 
Now I can compose a data set for data import/export using Field Chooser. The next step will be to retrieve the info about Ledger journals from Microsoft Dynamics AX 2012 using Refresh function
 
Refresh
 
 
Now it's time to use Publish function and create a brand-new Ledger journal in Microsoft Dynamics AX 2012 using Excel Add-in
 
Publish
 
 
When I try to publish the following error may occur if the user doesn't have permissions to execute operation
 
Publishing Details
 
 
This is because User KEN doesn't have access to the Server method which is one of possible securable objects in Microsoft Dynamics AX 2012 
 
In order to resolve this issue and grant appropriate access for User KEN I will create my own Role and assign User KEN to it
 
Security Role "Alex"
 
 
Duty
 
 
Privilege
 
 
Please note that I explicitly provided access to Server method (LedgerGeneralJournalService.create), so User KEN will be able to create Ledger journals
 
Add permissions to privilege
 
 
Add permissions to privilege
 
 
Now I'll assign User KEN to my new Security Role "Alex"
 
User KEN
 
 
Now I'll be able to successfully create Ledger journal in Microsoft Dynamics AX 2012
 
Publish
 
 
Publishing details
 
 
Here's the resulting Ledger journal in Microsoft Dynamics AX 2012
 
General journal
 
 
Please note that in terms of access to the business data you can also assign permissions to particular tables through Override permissions as shown below
 
 
This approach allows to granularly set up permissions for users to use Microsoft Dynamics AX 2012 Excel Add-in without assigning them to System Administrator role.
 
Summary: This document describes how to set up security settings required by Microsoft Dynamics AX 2012 Excel Add-in for data import/export following required minimum privilege principle.
Author: Alex Anikiev, PhD, MCP
 
Tags: Dynamics ERP, Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Add Tables, Add Data, Security Role, System Administrator.
 
Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples.
 

Dynamics AX 2012 Inventory transactions/on-hand Import using Excel Add-in

$
0
0
Dynamics AX 2012 Excel Add-in – Inventory transactions/on-hand Import



Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of inventory transactions (on-hand).

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. In fact the data model forming Inventory Journal was not dramatically changed and import principle remains the same – populate the journal and then post the journal. However surrogate key link was introduced to some tables related to Inventory Journal transactions table.

Solution: Microsoft Dynamics AX 2012 ships with lnventory Journal AIF Web Service (InventProfitLossJournalService) which can be used in integration scenarios. However Inventory Journal AIF Web Service can’t be used in Excel at the moment for import of inventory transactions. In order to import inventory transactions using Excel the appropriate tables will be used.

Assumption: The assumption is that appropriate reference data such as released products (items), etc. was created in advance.

Data Model:

Table Name

Table Description

InventJournalTable

The InventJournalTable table contains information about inventory journals. The table holds information about how the journal is handled by the system.

InventJournalTrans

The InventJournalTrans table contains information about items and represents a line in an inventory journal. Each record has information related to a specific item and is related to a record in the InventJournalTable table, which is the journal header.

Data Model Diagram:

image

Walkthrough:

Connection

image

Add Data

image

Dynamics AX – Error

image

Add Tables

image

Field Chooser

image

InventJournalTable

Field Name

Field Description

Journal

Name

Description

image

InventJournalTrans

Field Name

Field Description

Date

Item number

Journal

Line number

Dimension No

Quantity

Cost price

Cost amount

image

InventDim

image

Excel VLookup function may be used to find appropriate InventDimId automatically based on criteria

Sequence:

1.InventJournalTable – Publish Selected

2.InventJournalTrans – Publish Selected

Result:

Dynamics AX – Inventory Journal

image

Dynamics AX – Inventory Journal lines

image

Dynamics AX – On-hand

image

Dynamics AX – Posting

image

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of inventory transactions into Microsoft Dynamics AX 2012. Although Inventory Journal AIF Web Service (InventProfitLossJournalService) can’t be used at the moment in Excel for import of inventory transactions, appropriate tables can be used instead. Excel template can be created and used for import of inventory transactions.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Inventory on-hand.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.


Dynamics AX 2012 Sales orders Import using Excel Add-in

$
0
0
Dynamics AX 2012 Excel Add-in – Sales orders Import



Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of sales orders.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. In fact the data model forming Sales Orders was not dramatically changed and import principle remains the same – populate the header and related lines. However some information which is usually automatically generated in Microsoft Dynamics AX 2012 Rich Client by means of number sequences such as sales order ID will have to be provided.

Solution: Microsoft Dynamics AX 2012 ships with Sales Orders AIF Web Service (SalesSalesOrderService) which can be used in integration scenarios. However Sales Order AIF Web Service can’t be used in Excel at the moment for import of sales orders. In order to import a sales order using Excel the appropriate tables will be used.

Assumption: The assumption is that appropriate reference data such as customers, etc. was created in advance.

Data Model:

Table Name

Table Description

SalesTable

The SalesTable table contains all sales order headers regardless of whether they have been posted.

SalesLine

The SalesLine table contains all sales order lines regardless of whether they have been posted.

Data Model Diagram:

image

Walkthrough:

Connection

image

Add Data

Error

image

Solution

-Add replacement key to CreditCardCust table

-Add replacement key to AgreementHeader table

-Add replacement key to SourceDocumentHeader table

-Add replacement key to DocuValue table

-Add replacement key to CustInvoiceLineIdRef table

-Add replacement key to MarkupTrans table

-Add replacement key to CustInvoiceLineTemplate table

-Add replacement key to BankLC table

Error

image

No Solution yet

Add Tables

image

Field Chooser

image

Sales order ID number sequence

image

SalesTable

Field Name

Field Description

Currency

Customer account

Customer group

Invoice account

Language

Requested ship date

Sales order

image

SalesLine

Field Name

Field Description

Sales order

Currency

Customer

Group

Requested ship date

Source document line.Reference table ID

Item number

Quantity

Unit price

Net amount

Dimension No.

image

InventDim

image

Excel VLookup function may be used to find appropriate InventDimId automatically based on criteria

Sequence:

1.SalesTable - Publish Selected

2.SalesLine – Publish Selected

Result:

Dynamics AX – Sales Order

image

Dynamics AX – Sales Order Invoice

image

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of sales orders into Microsoft Dynamics AX 2012. Although Sales Order AIF Web Service (SalesSalesOrderService) can’t be used at the moment in Excel for import of sales orders, appropriate tables can be used instead. Excel template can be created and used for import of sales orders.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Sales orders.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Dynamics AX 2012 Free text invoices Import using Excel Add-in

$
0
0
Dynamics AX 2012 Excel Add-in – Free text invoices Import



Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of free text invoices.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. The data model forming Free text invoices was not dramatically changed and import principle remains the same – populate the header and related lines. In fact the link between the header and lines in build based on RecID which adds complexity.

Solution: Microsoft Dynamics AX 2012 ships with Free Text Invoice AIF Web Service (CustFreeTextInvoiceService) which can be used in integration scenarios. However Free Text Invoice AIF Web Service can’t be used in Excel at the moment for import of free text invoices. In order to import a free text invoices using Excel the appropriate tables will be used.

Assumption: The assumption is that appropriate reference data such as customers, etc. was created in advance.

Data Model:

Table Name

Table Description

CustInvoiceTable

The CustInvoiceTable table contains free text invoices.

CustInvoiceLine

The CustInvoiceLine table contains line items for an accounts receivable free text invoice.

Data Model Diagram:

image

Walkthrough:

Connection

image

Add Data

image

Error

image

Solution

-Add replacement key to CustInvoiceTable table

-Add replacement key to CustInvoiceLine table

Error

image

image

Data Model Changes

image

Temporary Key (Import ID)

image

ImportID is custom String field that is introduced to overcome the problem with Surrogate key based relations between tables in Excel add-in. Index1 is as I call it “Temporary Key” used during data conversion (data migration) process only. This Temporary key will be assigned to the header table as Non Surrogate Replacement key.

image

Lines table will still have relation to header table based on Surrogate key.

image

But because header table has Natural Replacement key Excel add-in will be able to translate Surrogate key based relation into Natural Key relation as design time (data entry) and vice versa, Natural Key relation to Surrogate key relation, during run time (publishing).

image

Proxy AIF classes

Table

Class

CustInvoiceTable

AxCustInvoiceTable

CustInvoiceLine

AxCustInvoiceLine

In order to regenerate Proxy AIF classes involved into Free text invoices import I used AIF Free Text Invoice Web Service (CustFreeTextInvoiceService) Update document service function available through Tools > AIF > Update document service in Development Workspace.

image

As the result appropriate AIF Proxy classes will be updated or created to support the translation ImportID - RecID.
image

Generate Incremental CIL

image

Add Tables

image

Field Chooser

image

CustInvoiceTable

Field Name

Field Description

Currency

Customer account

Date

Group

Import ID

Invoice account

Language

image

CustInvoiceLine

Field Name

Field Description

Customer free text invoice.Import ID

Description

LedgerDimension.Main account

Quantity

Unit price

Amount

image

Sequence:

1.CustInvoiceTable - Publish Selected

2.CustInvoiceLine – Publish Selected

Result:

Dynamics AX – Free text invoice

image

Dynamics AX – Free text invoice (Invoice)

image

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of free text invoices into Microsoft Dynamics AX 2012. Although Free Text Invoice AIF Web Service (CustFreeTextInvoiceService) can’t be used at the moment in Excel for import of free text invoices, appropriate tables can be used instead. Excel template can be created and used for import of free text invoices.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Free text invoices.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Dynamics AX 2012 Purchase orders Import using Excel Add-in

$
0
0
Dynamics AX 2012 Excel Add-in – Purchase orders Import



Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of purchase orders.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. In fact the data model forming Purchase Orders was not dramatically changed and import principle remains the same – populate the header and related lines. However some information which is usually automatically generated in Microsoft Dynamics AX 2012 Rich Client by means of number sequences such as purchase order ID will have to be provided.

Solution:

Assumption: The assumption is that appropriate reference data such as vendors, etc. was created in advance.

Data Model:

Table Name

Table Description

PurchTable

The PurchTable table contains all the purchase order headers regardless of whether they have been posted.

PurchLine

The PurchLine table contains all purchase order lines regardless whether they have been posted or not.

Data Model Diagram:

image

Walkthrough:

Connection

image

Error

image

image

Add Tables

image

Field Chooser

image

Purchase order ID number sequence

image

PurchTable

Field Name

Field Description

Currency

Invoice account

Language

Purchase order

Vendor account

Vendor group

image

PurchLine

Field Name

Field Description

Currency

Group

Lot ID

Purchase order

Vendor account

Item number

Quantity

Unit price

Net amount

Dimension No.

image

InventDim

image

Excel VLookup function may be used to find appropriate InventDimId automatically based on criteria

Sequence:

1.SalesTable - Publish Selected

2.SalesLine – Publish Selected

Result:

Dynamics AX – Purchase Order

image

Dynamics AX – Purchase Order Invoice

image

SQL Trace:

Summary:

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Purchase orders.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Dynamics AX 2012 Data Import using Excel Add-in

$
0
0

Dynamics AX 2012 Excel Add-in – Data Import

Purpose: The purpose of this document is to illustrate how to use Dynamics AX 2012 Excel Add-in for import of data.

Challenge: Data model changes in Dynamics AX related to high normalization and introduction of surrogate keys made import of data more complex. Additionally there are number of differences between Excel and AX Rich Client from UI standpoint when it comes to defaulting logic, use of number sequences, segmented controls and complex UI logic. AX Rich Client is obviously more dynamic comparing to Excel. However a lot of post-processing is usually done behind the scenes by means of AIF Proxy classes when the information is published into Dynamics AX.

Solution: Dynamics AX 2012 ships with the number of AIF Web Service which can be used in integration scenarios. However not all of them can be used in Excel at the moment for import of data. In order to import data using Excel the appropriate tables can be used instead.

Data Model:

Table Name

Table Description

AlexParent

Sample table

AlexTable

Sample header table which extends from sample table

AlexLine

Sample lines table

Data Model Diagram:

Sample Data Model

image

Walkthrough:

Connection

image

Add Tables

image

Dynamics AX Error

image

image

Solution

<!--[if !supportLists]-->-<!--[endif]-->Add replacement key to AlexParent table

<!--[if !supportLists]-->-<!--[endif]-->Add replacement key to AlexTable table

<!--[if !supportLists]-->-<!--[endif]-->Add replacement key to AlexLine table

Project

image

AlexParent table

image

AlexTable table

image

AlexLine table

image

Once Replacement key is added on AlexTable table Excel Add-in will be able to interpret Surrogate key relation between AlexTable table and AlexLine table using Natural key (Replacement key).

Table/Field Properties

image

Query

image

Generate AIF Proxy classes

Select Document Parameters

image

Select Code Generation Parameters

image

Completed

image

Project AxdAlex

image

Generate Incremental CIL

image

Field Chooser

Excel Add-in takes into account table inheritance

Also please note that ID field in AlexTable table (and ParentID field in AlexParent table) is used for Replacement Key <-> Surrogate Key translation

image

AlexTable

Field Name

Field Description

InstanceRelationType

ParentID

ID

A

B

C

D

image

AlexLine

Field Name

Field Description

AlexTable.ParentID

AlexTable.ID

E

F

image

Sequence:

<!--[if !supportLists]-->1.<!--[endif]-->AlexTable – Publish Selected

<!--[if !supportLists]-->2.<!--[endif]-->AlexLine – Publish Selected

Result:

Dynamics AX – Table Browser

AlexParent

image

AlexTable

image

AlexLine

image

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of data into Dynamics AX 2012. Although some of AIF Web Services can’t be used at the moment in Excel for import of data, appropriate tables can be used instead. Excel template can be created and used for import of data.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Table Inheritance, Surrogate Key, Natural Key, Replacement Key.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Dynamics AX 2012 Excel Add-in - Issues and Solutions

$
0
0

Dynamics AX 2012 Excel Add-in – Issues and Solutions

Purpose: The purpose of this document is to outline some issues you may encounter when using Dynamics AX 2012 Excel Add-in for import of data and provide solutions to resolve them.

Issue: “This operation is not supported for a relative URI”.

Reason: This issue occurs because AppFabric Service Bus endpoint is not configured. AppFabric Service Bus endpoints are similar to WCF endpoints. The only difference is that specific binding are used to communicate with relay service. The ‘sb’ represents the scheme used to communicate with the AppFabric Service Bus. The scheme can be either ‘http’ or ‘sb’ depending on the binding you are using. Endpoints can be configured in application configuration files or programmatically. Alternatively you can delete the endpoint if you don’t use it.

Dynamics AX Error

Solution: Please delete or configure ‘sb’ endpoint. ‘sb’ endpoint has no address defined which is treated by Dynamics AX Excel Add-in as relative URI. Below I show how to delete ‘sb’ endpoint.

Microsoft Dynamics AX Configuration Utility

Opening Microsoft Service Configuration Editor dialog

WCF Configuration Editor

Save Changes to WCF Configuration

Restart Excel

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Issue, Problem, Solution, Resolution.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the issues and describe the solutions.

Dynamics AX 2012 Excel Add-in - Replacement Keys

$
0
0

Dynamics AX 2012 Excel Add-in – Replacement Keys

Purpose: The purpose of this document is to illustrate options how to change Dynamics AX 2012 Data Model by adding appropriate Replacement keys to make Excel Add-in working to import the data.

Challenge: Data model changes in Dynamics AX related to high normalization and introduction of surrogate keys made import of data more complex. Currently Excel Add-in has a number of limitations as it relates to the Data Model. In order to allow Excel Add-in to interpret Surrogate key relations between tables correctly the specification of Replacement key (Natural key) is required.

Solution: Dynamics AX 2012 ships with close to 4500 tables. Some tables were designed and implemented for previous releases; some of them were designed and implemented for the current release. “New” tables leverage inheritance, Surrogate keys and relations based on Surrogate keys when “old” tables still have Natural keys and relations based on Natural keys. Please also note that for all newly created tables relations between tables in Dynamics AX 2012 should be specified on table level, at the same time some relations are still specified on “old” EDT’s in the system.

The example of “new” tables would be AgreementHeader and AgreementLine tables. AgreementLine table is linked with AgreementHeader table by Foreign key which is Surrogate key based.

The example of “old” tables would be LedgerJournalTable and LedgerJournalTrans tables. LedgerJournalTable table has Primary key based on JournalNum field (Natural key) and this JournalNum field is used to link LedgerJournalTable and LedgerJournalTrans tables together. That’s why in this case there’s no need to tweak the Data Model to make Excel Add-in working.

Data Model:

Table Name

Table Description

AlexTable

Sample header table

AlexLine

Sample lines table

Data Model Diagram:

Sample Data Model

Walkthrough:

Connection

Add Tables

Dynamics AX Error

Header AlexTable table

Solution – Option 1 (this is what I implemented in this example): Use existing field(s) which will form unique Natural key

-Add Replacement key to AlexTable table

Solution – Option 2: Introduce brand new field(s) which will form unique Natural key

-Add Replacement key to AlexTable table

Dynamics AX Error

Lines AlexLine table

Solution – Option 1: Use existing field(s) which will form unique Natural key

-Add Replacement key to AlexLine table

Solution – Option 2: Introduce brand new field(s) which will form unique Natural key

-Add Replacement key to AlexLine table

Solution – Option 3 (this is what I implemented in this example): Create unique Replacement key based on one of the existing fields and RecId field

-Add Replacement key to AlexLine table

The easiest option is Solution – Option 3 using one of existing fields and RecID field.

If your Replacement key would contain only RecId this would not be different from Surrogate key, RecId adds uniqueness to the index and if RecID is complimented with another non-RecID field then we have unique non-Surrogate key. However sometimes your table which requires Replacement key assignment may not even have fields other than system fields such as RecID or CreatedBy, ModifiedBy, etc. This may happen with tables participating in table inheritance. In this case new field may be added to the table. Then you can implement Solution – Option 2 with brand new field – ImportID in my examples. Please note that your unique index will be based on this field which means that you will have to populate this field with unique values for all existing records if any. The easiest way is to write X++ job and populate this new field (String) based on RecId values in the same table. Going forward unique values for that field will have to be provided in Excel Add-in interface explicitly.

Solution – Option 1 will work only if you already have existing field or combination of fields in the table which could be your Primary key. However this approach is not universal because all depends on the purpose of particular fields in the table.

Project

AlexTable table

AlexLine table

Once Replacement key is added on AlexTable table Excel Add-in will be able to interpret Surrogate key relation between AlexTable and AlexLine tables using Natural key (Replacement key).

Query

Generate AIF Proxy classes

Select Document Parameters

Select Code Generation Parameters

Completed

Project AxdAlex

Generate Incremental CIL

If you encounter this error

please delete cache* methods

Field Chooser

This is how Field Chooser will look like if you use Index1 = {ID} as Replacement key in header AlexTable table. Please note that ID field in AlexTable table is used for Replacement Key <-> Surrogate Key translation

This is how Field Chooser will look like if you use Index1 = {FieldA, FieldB} as Replacement key in header AlexTable table. Please note that the combination of fields FieldA and FieldB in AlexTable table is used for Replacement Key <-> Surrogate Key translation

This is how Field Chooser will look like if you use Index1 = {ImportID} as Replacement key in header AlexTable table. Please note that ImportID field in AlexTable table is used for Replacement Key <-> Surrogate Key translation

This is how Field Chooser will look like if you use Index1 = {FieldA, RecID} as Replacement key in header AlexTable table. Please note that FieldA field in AlexTable table is supposed to be used for Replacement Key <-> Surrogate Key translation

However if Replacement key for header AlexTable table contains RecID then you will get an exception when you try to import lines into AlexLine table.

Conclusion: All Replacement key Options including [existing field(s) + RecID] are applicable for lines (derived) AlexLine table. And all Replacement key Options excluding [existing field(s) + RecID] are applicable for header (main) AlexTable table.

AlexTable

Field Name

Field Description

ID

A

B

AlexLine

Field Name

Field Description

AlexTable.ID

C

D

Sequence:

1.AlexTable – Publish Selected

2.AlexLine – Publish Selected

Result:

Dynamics AX – Table Browser

AlexTable

AlexLine

SQL Trace:

Limitations:

Document Services

Document Services are based on a query that defines their structure. Only certain query structures are supported. The following are the restrictions on queries that form the basis of document services. Services which violate these rules may be added to the document data sources form by the administrator, but will result in errors when accessed in the add-in. For this reason it is important that developers and administrators test services for use with the add-in prior to adding them to this form.

·Replacement Keys:The root level of the document service (the parent data source) must have unique indexes other than Rec-ID. This may be in the form of a non-RecID Primary Index or a Replacement Key.

·Related Replacement Keys:Each field within the service which is a RecID-based foreign key must relate to a table that has a replacement key specified.

·Relationship Direction:When parent-child relationships exist in the underlying query associated with the service, only relationships originating on the child element, and pointing to the parent may be used. For example, in the CustCustomerService, the CustTable parent data source holds a foreign key to the DirParty child data source. This pattern is not supported in the Excel Add-in.

·Query and Service consistency:Document services are based on an underlying query which defines the data contract used in the service at the time that the service is generated. The Excel Add-in uses this query definition to perform read operations when refreshing data into the workbook. Because of this, any overrides to the read method, or extension of the schema beyond what is in the underlying query will not be reflected in the service.

·ViewSupport:Views may be used within document services to provide an easier to use data model for end users. However, the PrepareForXXXExtended methods must be implemented to properly handle information sent to the service within the views. Views may only be used as the “leaf” level node in the underlying query. For instance if there is a query “Parent, child, grandchild”, then only the grandchild node can be a view.

Only the following services shipped in Microsoft Dynamics AX 2012 are supported without modification in the Excel Add-in. Additional services meeting the above requirements can be constructed in order to extend the scenarios where excel can be used to update, create, and delete business data in Dynamics AX.

·BudgetTransaction

· EMSMeterReading

· EMSSubstanceFlow

· GeneralJournal

· ProductionPickingList

· ProjectHourJournals

· SysImportBusSector

· VendGroup

· VendRequestSignup

Supported tables

Not all tables presented in the “Add tables” dialog may be used with the Excel add-in, rather only those which meet the following requirements:

·Visible Identity:There must be a unique index on the table which does not contain RecID as a component. This may be either the “Replacement Key”, or the “Primary Index”

·Valid References:All relations in the relations collection for the table that refer to other tables via Rec-Id must be related to tables that have a “Replacement Key” specified.

Summary: In order to make Excel Add-in working to import the data the specification of Replacement key is required. Excel Add-in uses Replacement key to interpret Surrogate key based relations between tables. There’s multiple options how to change the Data Model and introduce Replacement key to the table: use existing field(s) which will form unique Natural key, introduce brand new field(s) which will form unique Natural key or create unique Replacement key based on one of the existing fields and RecID field.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Table Inheritance, Surrogate Key, Natural Key, Replacement Key.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Dynamics AX 2012 Purchase Agreements Import using Excel Add-in

$
0
0

Microsoft Dynamics AX 2012 Excel Add-in – Purchase agreements Import

Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of purchase agreements.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. Moreover Purchase Blanket orders functionality was completely redesigned and in Microsoft Dynamics AX 2012 it’s called Purchase Agreements now.

Solution: Microsoft Dynamics AX 2012 ships with a number of AIF Web Service which can be used in integration scenarios. However there’s no AIF Web Service out-of-the-box that can be used in Excel at the moment for import of purchase agreements.In order to import a purchase agreement using Excel the appropriate tables will be used.

Assumption: The assumption is that appropriate reference data such as customers, etc. was created in advance.

Data Model:

Table Name

Table Description

AgreementClassification

The AgreementClassification table contains the agreement classifications.

AgreementClassificationTranslation

The AgreementClassificationTranslation table contains the translations for the agreement classifications.

AgreementHeader

The AgreementHeader table contains each of the purchase and sales agreements.

AgreementHeaderDefault

The AgreementHeaderDefault table contains the release order defaulting policies.

AgreementHeaderDefaultHistory

The AgreementHeaderDefaultHistory table contains a snapshot of the release order defaulting policies.

AgreementHeaderHistory

The AgreementHeaderHistory table is a base table for the sales and purchase agreement header history tables.

AgreementLine

The AgreementLine table stores information about the purchase agreement details.

AgreementLineDefault

The AgreementLineDefault table contains the line release order defaulting policies.

AgreementLineDefaultHistory

The AgreementLineDefaultHistory table contains a snapshot of line release order defaulting policies.

AgreementLineHistory

The AgreementLineHistory table contains a snapshot of the agreement lines.

AgreementLineQuantityCommitment

The AgreementLineQuantityCommitment table contains each of the agreement lines of the quantity type.

AgreementLineQuantityCommitmentHistory

The AgreementLineQuantityCommitmentHistory table contains a snapshot of agreement quantity lines.

AgreementLineReference

The AgreementLineReference table contains the relation between intercompany sales agreement lines and intercompany purchase agreement lines.

AgreementLineReleasedLine

The AgreementLineReleasedLine table contains released agreement lines.

AgreementLineReleasedLineHistory

The AgreementLineReleasedLineHistory table contains a snapshot of released agreement lines.

AgreementLineVolumeCommitment

The AgreementLineVolumeCommitment table contains each of the agreement lines of the volume type.

AgreementLineVolumeCommitmentHistory

The AgreementLineVolumeCommitmentHistory table contains a snapshot of agreement volume lines.

AgreementReference

The AgreementReference table contains the relation between intercompany sales agreement headers and intercompany purchase agreement headers.

AgreementReleaseHeaderMatch

The AgreementReleaseHeaderMatch table contains matchings between agreements and orders.

PurchAgreementHeader

The PurchAgreementHeader table contains purchase agreement headers.

PurchAgreementHeaderDefault

The PurchAgreementHeaderDefault table contains the release purchase order defaulting policies.

PurchAgreementHeaderDefaultHistory

The PurchAgreementHeaderDefaultHistory table contains a snapshot of the release purchase order defaulting policies.

PurchAgreementHeaderHistory

The PurchAgreementHeaderHistory table contains a snapshot of the purchase agreement header record.

PurchTable

The PurchTable table contains all the purchase order headers regardless of whether they have been posted.

PurchLine

The PurchLine table contains all purchase order lines regardless whether they have been posted or not.

Data Model Diagram:

Agreements

Red area highlights tables forming Agreements – Headers data model

Green area highlights tables forming Agreements – Lines data model

Blue area highlights tables forming Purchase Agreements data model

Release orders

VSD: https://docs.google.com/open?id=0B3rbAZy5q2ExNGNiYzEwODctY2Y4ZC00OGFlLWJiNjMtNDMxMGFjNzc4Nzk2

Walkthrough:

Connection

Add Tables

Dynamics AX Error

Solution:

-Add replacement key to AgreementHeader table

I decided to re-use existing DocumentTitle field as Replacement key without introduction of brand new field (Temporary key) and regeneration of AIF Proxy classes here. That’s why I re-populated DocumentTitle field for all existing records using RecID and assigned Index1 = {DocumentTitle} as Replacement key to AgreementHeader table.

Field Chooser

PurchAgreementHeader

Field Name

Field Description

Agreement classification.AgreementRelationType

Agreement classification.Name

Currency

Vendor account

InstanceRelationType

Purchase agreement ID

IsDeleted

Vendor account.VendorDataAreaId

Document title

Legal entities.DataArea

Legal entities.Name

Party ID

Legal entities.Party ID

Legal entities.Party type

AgreementLine

Field Name

Field Description

Dimension No..InventDimDataAreaId

Dimension No.

Item number

Item number.ItemDataAreaId

Agreement header record ID.InstanceRelationType

Agreement header record ID.Document title

Effective date

Expiration date

InstanceRelationType

Line number

Quantity

Unit

Unit price

IsDeleted

InventDim

Excel VLookup function may be used to find appropriate InventDimId automatically based on criteria

Sequence:

1.PurchAgreementHeader - Publish Selected

2.AgreementLine – Publish Selected

Result:

Dynamics AX – Purchase Agreement

Dynamics AX – Release Order

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of purchase agreements into Microsoft Dynamics AX 2012. Although there’s no AIF Web Service out-of-the-box that can be used at the moment in Excel for import of purchase agreements, appropriate tables can be used instead. Excel template can be created and used for import of purchase agreements.

Author: Alex Anikiev, PhD, MCP


Dynamics AX 2012 Sales Agreements Import using Excel Add-in

$
0
0

Microsoft Dynamics AX 2012 Excel Add-in – Sales agreements Import

Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of sales agreements.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. Moreover Sales Blanket orders functionality was completely redesigned and in Microsoft Dynamics AX 2012 it’s called Sales Agreements now.

Solution: Microsoft Dynamics AX 2012 ships with a number of AIF Web Service which can be used in integration scenarios. However there’s no AIF Web Service out-of-the-box that can be used in Excel at the moment for import of sales agreements.In order to import a sales agreement using Excel the appropriate tables will be used.

Assumption: The assumption is that appropriate reference data such as customers, etc. was created in advance.

Data Model:

Table Name

Table Description

AgreementClassification

The AgreementClassification table contains the agreement classifications.

AgreementClassificationTranslation

The AgreementClassificationTranslation table contains the translations for the agreement classifications.

AgreementHeader

The AgreementHeader table contains each of the purchase and sales agreements.

AgreementHeaderDefault

The AgreementHeaderDefault table contains the release order defaulting policies.

AgreementHeaderDefaultHistory

The AgreementHeaderDefaultHistory table contains a snapshot of the release order defaulting policies.

AgreementHeaderHistory

The AgreementHeaderHistory table is a base table for the sales and purchase agreement header history tables.

AgreementLine

The AgreementLine table stores information about the purchase agreement details.

AgreementLineDefault

The AgreementLineDefault table contains the line release order defaulting policies.

AgreementLineDefaultHistory

The AgreementLineDefaultHistory table contains a snapshot of line release order defaulting policies.

AgreementLineHistory

The AgreementLineHistory table contains a snapshot of the agreement lines.

AgreementLineQuantityCommitment

The AgreementLineQuantityCommitment table contains each of the agreement lines of the quantity type.

AgreementLineQuantityCommitmentHistory

The AgreementLineQuantityCommitmentHistory table contains a snapshot of agreement quantity lines.

AgreementLineReference

The AgreementLineReference table contains the relation between intercompany sales agreement lines and intercompany purchase agreement lines.

AgreementLineReleasedLine

The AgreementLineReleasedLine table contains released agreement lines.

AgreementLineReleasedLineHistory

The AgreementLineReleasedLineHistory table contains a snapshot of released agreement lines.

AgreementLineVolumeCommitment

The AgreementLineVolumeCommitment table contains each of the agreement lines of the volume type.

AgreementLineVolumeCommitmentHistory

The AgreementLineVolumeCommitmentHistory table contains a snapshot of agreement volume lines.

AgreementReference

The AgreementReference table contains the relation between intercompany sales agreement headers and intercompany purchase agreement headers.

AgreementReleaseHeaderMatch

The AgreementReleaseHeaderMatch table contains matchings between agreements and orders.

SalesAgreementHeader

The SalesAgreementHeader table contains all of the sales agreement header specific information.

SalesAgreementHeaderDefault

The SalesAgreementHeaderDefault table contains the release sales order defaulting policies.

SalesAgreementHeaderDefaultHistory

The SalesAgreementHeaderDefaultHistory table contains a snapshot of release sales order defaulting policies.

SalesAgreementHeaderHistory

The SalesAgreementHeaderHistory table contains a snapshot of sales agreement headers.

SalesTable

The SalesTable table contains all sales order headers regardless of whether they have been posted.

SalesLine

The SalesLine table contains all sales order lines regardless of whether they have been posted.

Data Model Diagram:

Agreements

Red area highlights tables forming Agreements – Headers data model

Green area highlights tables forming Agreements – Lines data model

Yellow area highlights tables forming Sales Agreements data model

Release orders

VSD: https://docs.google.com/open?id=0B3rbAZy5q2ExNGNiYzEwODctY2Y4ZC00OGFlLWJiNjMtNDMxMGFjNzc4Nzk2

Walkthrough:

Connection

Add Tables

Dynamics AX Error

Solution:

-Add replacement key to AgreementHeader table

I decided to re-use existing DocumentTitle field as Replacement key without introduction of brand new field (Temporary key) and regeneration of AIF Proxy classes here. That’s why I re-populated DocumentTitle field for all existing records using RecID and assigned Index1 = {DocumentTitle} as Replacement key to AgreementHeader table.

Field Chooser

SalesAgreementHeader

Field Name

Field Description

Agreement classification.AgreementRelationType

Agreement classification.Name

Currency

Customer account

InstanceRelationType

Sales agreement ID

IsDeleted

Customer account.CustomerDataAreaId

Document title

Legal entities.DataArea

Legal entities.Name

Party ID

Legal entities.Party ID

Legal entities.Party type

AgreementLine


Field Name

Field Description

Dimension No..InventDimDataAreaId

Dimension No.

Item number

Item number.ItemDataAreaId

Agreement header record ID.InstanceRelationType

Agreement header record ID.Document title

Effective date

Expiration date

InstanceRelationType

Line number

Quantity

Unit

Unit price

IsDeleted

InventDim

Excel VLookup function may be used to find appropriate InventDimId automatically based on criteria

Sequence:

1.SalesAgreementHeader - Publish Selected

2.AgreementLine – Publish Selected

Result:

Dynamics AX – Sales Agreement

Dynamics AX – Release Order

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of sales agreements into Microsoft Dynamics AX 2012. Although there’s no AIF Web Service out-of-the-box that can be used at the moment in Excel for import of sales agreements, appropriate tables can be used instead. Excel template can be created and used for import of sales agreements.

Author: Alex Anikiev, PhD, MCP

Dynamics AX 2012 Excel Add-in - Add Data

$
0
0

Dynamics AX 2012 Excel Add-in – Add Data

Purpose: The purpose of this document is to illustrate how to enable AIF Web Service for Dynamics AX 2012 Excel Add-in.

Task: In order to enable AIF Web Service for Dynamics AX 2012 Excel Add-in 2 main prerequisites have to be met: AIF Web Service has to be deployed as a part of Service Group and AIF Web Service has to be added to Document Data Sources. This document describes the sequence of steps on how to enable existing (standard) or brand-new (custom) AIF Web Service for Dynamics AX 2012 Excel Add-in.

Data Model:

Table Name

Table Description

AlexTable

Sample table

Data Model Diagram:

Sample Data Model

Walkthrough:

Existing (standard) AIF Web Service

In this demonstration I will enable existing VendVendTableService (Vendor) AIF Web Service for Dynamics AX 2012 Excel Add-in

At the beginning VendVendTableService AIF Web Service is not available in Excel Add-in

In order to deploy VendVendTableService AIF Web Service I will add it to AccountsPayableServices Service Group which is currently not deployed

I added VendVendTableService AIF Web Service to AccountsPayableService Service Group in AOT and then deployed Service Group

After Service Group is deployed you will see the following infolog

Now Service Group will be activated in Inbound ports form in Administration > Setup > AIF

Please note that you can see WSDL in Web Browser as shown below

Finally VendVendTableService AIF Web Service has to be added to Document Data Sources form

Result:

VendVendTableService AIF Web Service is now available in Excel Add-in

Brand-new (custom) AIF Web Service

In this demonstration I will create custom AlexQueryService AIF Web Service

Project

Create Document Service

Welcome

Select document parameters

Select code generation parameters

Generate code

Completed

AxdAlexQuery Project

Generate incremental CIL

AIF Web Service

Add AIF Web Service to Service Group

Deploy Service Group

After Service Group is deployed you will see the following infolog

AlexServiceGroup will now be activated in Inbound ports form

Also you can see WSDL in Web Browser

Finally you will have to add AIF Web Service in Document data sources form

Result:

AlexQueryService AIF Web Service is now available in Excel Add-in

Summary: In order to enable AIF Web Service for Dynamics AX 2012 Excel Add-in 2 main prerequisites have to be met: AIF Web Service has to be deployed as a part of Service Group from AOT or from Inbound ports form in Administration > Setup > AIF and AIF Web Service has to be added to Document Data Sources on Document data sources form in Organization administration > Setup > Document management. You can add your AIF Web Service to newly created custom Service Group for deployment, or you can add your AIF Web Service to existing Service Group and redeploy it.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Web Service, Add Data.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples.

Dynamics AX 2012 Excel Add-in - Storage Dimensions

$
0
0

Dynamics AX 2012 Excel Add-in - Storage Dimensions

Purpose: The purpose of this document is to illustrate how to work with Storage Dimensions in Dynamics AX 2012 Excel Add-in.

Challenge: Data model changes in Dynamics AX related to high normalization and introduction of surrogate keys made import of data more complex. Additionally there are number of differences between Excel and AX Rich Client from UI standpoint when it comes to handling Inventory dimensions. AX Rich Client is obviously more dynamic comparing to Excel. AX Rich Client has a number of specialized classes to support Inventory dimensions related operations and UI.

Solution: Dynamics AX 2012 ships with the number of AIF Web Service which can be used in integration scenarios. However not all of them can be used in Excel at the moment for import of data. In order to manipulate with Storage Dimensions using Excel the appropriate tables can be used. In my example I’ll import required Storage Dimensions, then import Sales Orders information and specify Storage Dimensions related to Sales Order line.

Data Model:

Table Name

Table Description

InventSite

The InventSite table contains information about sites.

InventLocation

The InventLocation table contains information about warehouses.

WMSLocation

The WMSLocation table contains information about locations.

WMSPallet

The WMSPallet table contains information about pallets.

InventDim

The InventDim table contains values for inventory dimensions.

InventSum

The InventSum table contains information about the present and expected on-hand stock of items.

Data Model Diagram:

Inventory Dimensions

image

Red area highlights tables forming Product Dimensions data model

Green area highlights tables forming Storage Dimensions data model

Blue area highlights tables forming Tracking Dimensions data model

Storage Dimensions

image

In Rich Client when Inventory Dimensions are specified, for example, on Sales order line or Purchase order line the system will automatically create InventDim table record and allocate InventDimId value if specified combination of inventory dimensions doesn’t exist in InventDim table yet, otherwise existing InventDimId which corresponds to the specified combination will be re-used. This means that the system will not create InventDim table record for the combination which is not yet used. If you create Sales order line or Purchase order line programmatically using X++ you would use Tables\InventDim\findOrCreate method to assign proper InventDimId to SalesLine table buffer or PurchLine table buffer.

In Excel Add-in there’s no dedicated control related to InventDimId EDT (InventDimId field) yet to enable automatic creation of InventDim table record based on Inventory Dimensions - “segments”. I would anticipate that we have something similar to Excel Add-in segmented control for DimensionDynamicAccount EDT (LedgerDimension field).

InventDimId field lookup

LedgerDimension field lookup

image

image

If you modify AutoLookup field group in InventDim table to include {InventDimId, ConfigId, InventSizeId, InventColorId, InventSiteId, InventLocationId, WMSLocationId, WMSPalletId, InventBatchId, InventSerialId} fields then you can get full list of Inventory Dimensions displayed on Excel Add-in lookup form, however you will still have to specify existing InventDimId before you can create Sales order line or Purchase order line for specific combination of Inventory Dimensions.

In order to resolve this problem appropriate combinations of Inventory Dimensions will have to be created upfront and then Excel VLOOKUP function can be used to pull out the particular InventDimId and apply it to specific Sales order line or Purchase order line.

Excel Add-in can be used to create combinations of Inventory Dimensions in InventDim table.

Alternatively you can write X++ job that will programmatically create desired combinations of Inventory Dimensions for you. Please see the example of X++ job below

Storage Dimensions in Dynamics AX 2012 are Site, Warehouse, Location and Pallet.

Storage Dimensions Walkthrough:

Connection

Add Tables

Field Chooser

InventSite

Field Name

Field Description

Site

Name

SiteReqPolicy

Field Name

Field Description

Site

Use transfer journals for movements within site

InventLocation

Field Name

Field Description

Site

Warehouse

Name

Result

Dynamics AX – Site

Dynamics AX – Warehouse

Add Tables

Field Chooser

InventDim

Field Name

Field Description

<unbound>

Combination

InventDim.InventDimId

Dimension No.

InventDim.InventSiteId

Site

InventDim.InventLocationId

Warehouse

Please note that I added unbound Combination field into Ax_InventDim table

Combination field is simple concatenation of 2 strings {Site, Warehouse} with “” delimiter in the middle. This field will be used in VLOOKUP function during the import of Sales Order lines in order to put correct InventDimId value in SalesLine.InventDimId field.

Usually when you are doing Data Import you either don’t have InventDimId easily accessible or you do by opening Table Browser or another Excel tab with InventDim table data, and ultimately anyways you’ll have to copy and paste InventDimId value into, for example, SalesLine.InventDimId field.

In fact you will always have an information about what Site and Warehouse (in my example) this Sales Order line should belong to even not having InventDimId value.

That’s why I’m going introduce similar Combination field in Ax_SalesLine table to compare it against Combination field in Ax_InventDim table and automatically put required InventDimId value in SalesLine.InventDimId without a need to manually do copy and paste.

Publish Selected – InventDim

Result

Dynamics AX – Table Browser

Sales order ID number sequence

SalesTable

Field Name

Field Description

Currency

Customer account

Customer group

Invoice account

Language

Requested ship date

Sales order

SalesLine

Field Name

Field Description

<unbound>

Combination

Currency

Customer

Group

Requested ship date

Sales order

Item number

Quantity

Unit

Unit price

Net amount

SalesLine.InventDimId

Dimension No.

<unbound>

Site

<unbound>

Warehouse

Please note that I added similar unbound Combination field into Ax_SalesLine table. The difference here is that Site and Warehouse fields in Ax_SalesLine table are also unbound. Again, usually you have the information about Site and Warehouse (in my example) particular Sales Order line should belong, but you don’t have InventDimId value itself. This becomes critical when you have a lot of combinations of Inventory Dimensions to be introduced into the system as a part of Data Import which will support Sales Order lines.

Similarly Combination field is simple concatenation of 2 strings {Site, Warehouse} with “” delimiter in the middle and it will be used in comparison against Combination field in Ax_InventDim table in order to put correct InventDimId value into SalesLine.InventDimId field.

Publish Selected – Sales Line

Please note that bound InventDimId field in SalesLine table has a formula associated that uses VLOOKUP function. This is how we compare Combination fields in Ax_InventDim and Ax_SalesLine tables to find out about correct InventDimId value to be used in SalesLine.InventDimId field.

By other words, I’m looking for the value from Combination field from Ax_SalesLine table (1st parameter) in Ax_InventDim table (2nd parameter). If exact match (4th parameter) was found then the value in 2nd column (3rd parameter) will be returned as the result.

Please note that by default the category in InventDimId field is Text which has to be changed to General to be able to apply the formula.

Please note that there’re number of prerequisites in order to apply VLOOKUP formula correctly.

Important:

1.Combination field has to be left-most field in Ax_SalesLine table

2.No duplicate values are allowed in Combination field in Ax_InventDim table because we are looking for the exact match

3.You can use static named ranges, absolute cells coordinates or table name(s) in Excel to effectively define table_array value (2nd parameter in VLOOKUP function)

You may define Filter criteria to fetch only certain InventDim table records into Ax_InventDim table in Excel. Consequently it may happen that there’s no match found in Ax_InventDim table, so Excel will put #NA value into the cell. In order to substitute #NA (Not Available) to something more meaningful you can change VLOOKUP formula to be

=IF(ISNA(VLOOKUP([Combination],Ax_InventDim,2,FALSE)),"AllBlank",VLOOKUP([Combination],Ax_InventDim,2,FALSE))

Please note that “AllBlank” represents the record in InventDim table which has no Inventory Dimensions defined

After Sales Order line(s) information gets published the system will reread the information and display the results to you, consequently you will have a value displayed in InventDimId field in SalesLine table instead of VLOOKUP formula.

Result:

Dynamics AX – Sales Order

Dynamics AX – Sales Order Invoice

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of data into Dynamics AX 2012. Although there’s no AIF Web Service to import Inventory Dimensions combinations (into InventDim table) upfront, appropriate tables can be used instead. Excel template can be created and used for import of data.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Inventory Dimensions, Storage Dimensions.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Dynamics AX 2012 Excel Add-in - Customer transactions import

$
0
0

Microsoft Dynamics AX 2012 Excel Add-in – Customer transactions Import

Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of customer transactions with required level of detail.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. In fact the data model forming General Journal was not dramatically changed and import principle remains the same – populate the journal and then post the journal. Numerous fields are available on General Journal line level in Rich client to achieve required level of detail during import. In order to import customer transactions with required level of detail using Excel Add-in some additional work may be required.

Solution: Microsoft Dynamics AX 2012 ships with General Journal AIF Web Service (LedgerGeneralJournalService) which can be used in integration scenarios. Also General Journal AIF Web Service can be used in Excel for import of customer transactions. However General Journal AIF Web Service may not expose all fields which may be required for import such as Invoice, etc. In this walkthrough in order to import customer transactions using Excel the appropriate tables will be used instead. Some additional work will be done after initial import to align customer account.

Assumption: The assumption is that appropriate reference data such as customers, etc. was created in advance.

Data Model:

Table Name

Table Description

LedgerJournalTable

The LedgerJournalTable table contains all the defaulting and state information pertaining to a single journal. The transaction details of a journal are managed in the LedgerJournalTrans table.

LedgerJournalTrans

The LedgerJournalTrans table contains the transaction detail information that pertains to a single journal. The individual transaction lines are also referred to as voucher lines. The journal is a record in the LedgerJournalTable table.

Data Model Diagram:

Walkthrough:

AxdLedgerGeneralJournal Query

General Journal AIF Web Service doesn’t expose all fields which may be required for import such as Invoice, etc.

In order to bring Customer account information over to AX I introduced CustAccount field into LedgerJournalTrans table as shown below

CustAccount field is based on CustAccount EDT which in its turn has relation to CustTable table

After mentioned customizations will be introduced you will have to regenerate AIF Proxy classes in order to reflect changes in the data model. I used LedgerGeneralJournalService AIF Web Service because it has LedgerJournalTable and LedgerJournalTrans tables as data sources, this is exactly the tables I need AIF Proxy classes to be regenerated for.

Update document service

After you complete steps required to Update document service as it’s described in “Import Data” walkthrough you will need to generate incremental CIL.

Generate Incremental CIL

Connection

Add Tables

Dynamics AX Error

Solution:

-Add replacement key to VendTrans table {Field, RecId}

-Add replacement key to CustTrans table {Field, RecId}

-Add replacement key to LedgerJournalTrans table {Field, RecId}

-Add replacement key to ReasonTableRef table {Field, RecId}

-Add replacement key to VendBankAccount table {Field, RecId}

-Add replacement key to CustBankAccount table {Field, RecId}

-Add replacement key to BudgetSource table {Field, RecId}

-Add replacement key to BudgetTransactionLine table {Field, RecId}

Field Chooser

Accounting structure

Dynamics AX Error

When you unpress Field Chooser button you may see “The number of joins in the statement is X. This exceeds the maximum of 26. …” error

This error occurs because of numerous relations specified on LedgerJournalTrans and LedgerJournalTable tables. As opposite to AIF Web Service where the data set is strictly defined by the Query, in the case when raw tables are being used the system is building composite data set based on relations specified on tables/EDT level

In order to bypass this error you will have to change “Maximum buffer size (KB)” setting in Dynamics AX Server Configuration Utility and restart AX AOS

Dynamics AX Server Configuration Utility

LedgerJournalTable

Field Name

Field Description

Journal batch number

Name

Description

LedgerJournalTrans

Field Name

Field Description

Journal batch number

Voucher

Date

Company accounts

Account type

LedgerJournalTrans.CustAccount <custom>

Customer account

DefaultDimension.Department

Description

Debit

Credit

Currency

LedgerJournalTrans.Invoice

Invoice

Offset company accounts

Offset account type

OffsetLedgerDimension

OffsetLedgerDimension.Main Account

OffsetLedgerDimension.Department

Offset-transaction text

1)

2)

3)

Please note that I added Invoice fieldwhich is not included in General Journal AIF Web Service data set by default. Also to manipulate with Customer account I added custom CustAccount field, after initial import this field will be used in X++ Job to populate LedgerDimension field in LedgerJournalTrans table based on Customer account specified. In my previous walkthroughs I used different approach which doesn’t require the customization of AX data model (the structure of LedgerJournalTrans table) when I used Description field to bring Customer account info over to AX.

When you will try to publish LedgerJournalTrans table data you will see “Method AxdBase.getDimensionId must be overridden” error

Dynamics AX Error

This error occurs because there’s no behavior defined in Generic document AIF document class (AxdGenericDocument) which is used when you work with raw tables as it relates to LedgerDimension field(s) processing.

Please note that General Journal AIF document class does have this behavior defined, that’s why it can handle LedgerDimension field(s) fine.

Actually the actual LedgerDimension field(s) handling happens during deserialization in AxdLedgerGeneralJournal class, here in getDimensionId method the values get stored for future processing.

Solution:

The next logical step is to override getDimensionId method in AxdGenericDocument class assuming that we just want to import customer transactions for now

However with this code (stub) we can bypass the error but not populate LedgerDimension field(s) values appropriately. In order to populate LedgerDimension field(s) values I modified this method to look like the following

This will take care of populating Offset account on General Journal line level properly when using raw tables. Please note that Customer account field will be populated separately and then X++ job will be used to populate appropriate LedgerDimension value which corresponds to particular Customer account.

X++ Job

Sequence:

1.LedgerJournalTable – Publish Selected

2.LedgerJournalTrans – Publish Selected

Result:

Dynamics AX – General Journal

Dynamics AX – Execute X++ Job

Dynamics AX – General Journal lines

Dynamics AX – General Ledger Posting

Alternatives:

Alternatively General Journal AIF Web Service (LedgerGeneralJournalService) Query may be modified to accommodate for more fields required for import such as Invoice, etc. This approach is much easier to implement by the user.

After you customize the Query document service must be updated using Update document service function in Developer workspace and then incremental CIL must be generated.

As an alternative to introduction of brand new field CustAccount to bring over Customer account information to AX you can make use LedgerDimension.MainAccount field.

LedgerJournalTrans

This trick will require the customization of AxdGenericDocument AIF document class in order to handle special behavior associated with LedgerDimension field(s) (LedgerDimension, OffsetLedgerDimension) as shown below

Here I assume that in Account field I specify Customer account and in Offset account field I specify Ledger account (Clearing account).

Using these ideas to facilitate import effort the same result will be achieved! The difference is in the amount of customizations introduced in order to import the data.

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of customer transactions into Microsoft Dynamics AX 2012. General Journal AIF Web Service (LedgerGeneralJournalService) can be used in Excel for import of customer transactions. However General Journal AIF Web Service (LedgerGeneralJournalService) doesn’t expose all fields which may be required for import. In this case General Journal AIF Web Service (LedgerGeneralJournalService) Query may be customized to accommodate for more fields, or raw tables may be used instead. Excel template can be created and used for import of customer transactions.

In this document raw tables approach was implemented to import customer transactions with required level of detail to demonstrate the mechanics of the process. In another similar walkthrough dedicated to import of vendor transactions with required level of detail I’ll focus on General Journal AIF Web Service modification approach which is much easier to implement for the user.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Customer transactions.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. Please remove all Data Model changes introduced as a part of this demonstration once you complete data import exercise.

Dynamics AX 2012 Excel Add-in - Vendor transactions import

$
0
0

Microsoft Dynamics AX 2012 Excel Add-in – Vendor transactions Import

Purpose: The purpose of this document is to illustrate how to use Microsoft Dynamics AX 2012 Excel Add-in for import of vendor transactions with required level of detail.

Challenge: Data model changes in Microsoft Dynamics related to high normalization and introduction of surrogate keys made some imports more complex. In fact the data model forming General Journal was not dramatically changed and import principle remains the same – populate the journal and then post the journal. Numerous fields are available on General Journal line level in Rich client to achieve required level of detail during import. In order to import vendor transactions with required level of detail using Excel Add-in some additional work may be required.

Solution: Microsoft Dynamics AX 2012 ships with General Journal AIF Web Service (LedgerGeneralJournalService) which can be used in integration scenarios. Also General Journal AIF Web Service can be used in Excel for import of vendor transactions. However General Journal AIF Web Service may not expose all fields which may be required for import such as Invoice, etc. In this walkthrough in order to import vendor transactions using Excel I’m going to modify General Journal AIF Web Service (LedgerGeneralJournalService), alternatively the appropriate tables may be used instead. Please note that I’ll make use of Main account field to bring Vendor account information over to Microsoft Dynamics AX 2012, so no additional work will be required to align vendor account comparing to similar walkthrough where I import customer transactions using raw tables.

Assumption: The assumption is that appropriate reference data such as vendors, etc. was created in advance.

Data Model:

Table Name

Table Description

LedgerJournalTable

The LedgerJournalTable table contains all the defaulting and state information pertaining to a single journal. The transaction details of a journal are managed in the LedgerJournalTrans table.

LedgerJournalTrans

The LedgerJournalTrans table contains the transaction detail information that pertains to a single journal. The individual transaction lines are also referred to as voucher lines. The journal is a record in the LedgerJournalTable table.

Data Model Diagram:

Walkthrough:

AxdLedgerGeneralJournal Query

General Journal AIF Web Service doesn’t expose all fields which may be required for import such as Invoice, etc.

In order to get access to more fields for vendor transactions import when using General Journal AIF Web Service AxdLedgerGeneralJournal Query will have to be modified appropriately

That’s why I added Invoice field into the list of fields for LedgerJournalTrans data source

Please note that Invoice field is already included in LedgerJournalTrans table and has appropriate support in AxLedgerJournalTrans AIF Proxy class

So there’s no need to Update document service (LedgerGeneralJournalService) and regenerate AIF Proxy class(es). However in order to enable Invoice field to be used by General Journal AIF Web Service appropriate Service Group (LedgerServices) which contains LedgerGeneralJournalService AIF Web Service will have to be redeployed.

Once LedgerServices Service Group is redeployed you will see the following infolog

You can also see LedgerServices Service Group activated in Inbound ports form in Administration > Setup > Application Integration Framework

Please note that if you will manually create Enhanced port, say LedgerServicesAlex

And then select “create” operation on LedgerGeneralJournalService AIF Web Service in Select service operations form

Eventually you will be able to see Invoice field listed in Document data policies form

This is a proof that Invoice field will now be available for use by General Journal AIF Web Service

Connection

Add Data

Field Chooser

Accounting structure

LedgerJournalTable

Field Name

Field Description

Journal batch number

Name

Description

LedgerJournalTrans

Field Name

Field Description

Journal batch number

Voucher

Date

Company accounts

Account type

LedgerDimension

LedgerDimension.Main Account

LedgerDimension.Department

DefaultDimension.Department

Description

Debit

Credit

Currency

LedgerJournalTrans.Invoice

Invoice

Offset company accounts

Offset account type

OffsetLedgerDimension

OffsetLedgerDimension.Main Account

OffsetLedgerDimension.Department

Offset-transaction text

1)

2)

3)

4)

Sequence:

1.GeneralJournalService – Publish All

Result:

Dynamics AX – General Journal

Dynamics AX – General Journal lines

Please note that Invoice field is properly propagated on Invoice tab

Dynamics AX – General Ledger Posting

It’s important to mention that I used Main account field to bring over Vendor account information to Microsoft Dynamics AX 2012 without any customizations. This is possible because AxdLedgerGeneralJournal document class has the logic to assign appropriate LedgerDimension value based on value specified in Main account field and actual Account type defined (in our case it’s Vendor) in afterDeserializeEntity method as shown below

SQL Trace:

Summary: For the purposes of small or medium data migration (data conversion) where performance is not a concern Excel can be used for import of vendor transactions into Microsoft Dynamics AX 2012. General Journal AIF Web Service (LedgerGeneralJournalService) can be used in Excel for import of vendor transactions. However General Journal AIF Web Service (LedgerGeneralJournalService) doesn’t expose all fields which may be required for import. In this case General Journal AIF Web Service (LedgerGeneralJournalService) Query may be customized to accommodate for more fields, or raw tables may be used instead. Excel template can be created and used for import of vendor transactions.

In this document I modified General Journal AIF Web Service (LedgerGeneralJournalService) to import vendor transactions with required level of detail. In another similar walkthrough dedicated to import of customer transactions with required level of detail I’ll use raw tables approach to illustrate the mechanics of the process better. Raw tables approach is much more complex than AIF Web Service modification approach for the user.

Author: Alex Anikiev, PhD, MCP

Tags: Dynamics ERP,Dynamics AX 2012, Excel, Dynamics AX 2012 Excel Add-in, Data Import, Data Conversion, Data Migration, Application Integration Framework, Vendor transactions.

Note: This document is intended for information purposes only, presented as it is with no warranties from the author. This document may be updated with more content to better outline the concepts and describe the examples. It’s recommended that all Data Model changes introduced as a part of this demonstration will be removed once you complete data import exercise.

Viewing all 41 articles
Browse latest View live