最新消息:ww12345678 的部落格重装上线,希望大家继续支持。

Using the crossreference system as a learning tool

网络文摘 William 1858浏览 0评论

There can be times when you are unsure of how and why a certain feature works in AX. For example how a certain field is calculated or the effect of defining a particular parameter. For this, it is often useful to go ‘under the hood’ to get a direct view of the logic in place.

In this blog we will see how we can use the AX cross reference system to help us locate the exact places in the code where the feature you are interested in has been coded in. For more on the AX crossreference system and in particular how to set it up, you can consult this site https://msdn.microsoft.com/en-us/library/aa877386.aspx

Example

In this example I am interested in learning how and where the AX error account is used in the system. To find out, I would do the following steps

1. Locate the form where the feature I am interested in is defined. In this case, General LedgerSetupPostingAccounts for automatic transactions

CR01

2. Once I have opened my form, I want to know more about the settings of the ‘Error account’

CR2

3. The first thing I would do is find out the name of the table and field that is listed in the form here. To do this, the easiest way is to rightlick and select ‘Personalize’

CR3

4. Note then how the focus on the left pane is on the field you put your cursor in, in this case ‘Posting type’ and to the right, you can see the table name and associated field

CR4

In this case I can see that the posting type field is associated with the table ‘LedgerSystemAccounts’ and the field is ‘Code’

5. I go to the AOT, short cut from the application is pressing Ctrl + D and locate the ‘LedgerSystemAccounts’ table(DataDictionaryTables) and go to the field ‘Code’

On the ‘Code’ field I rightclick and select ‘Properties’ and take a note of the Enum type of the field as I know the field is an Enum(a drop down list). I note the enum is called ‘LedgerPostingType’

CR06a

6. I proceed to locate this enum by going to Data DictionaryBase Enums

I expand the ‘LedgerPostingType’ enum and go to ‘ErrorAccount’ as this is what I am interested in

CR7

On the ‘ErrorAccount’ node I righclick and select ‘Add-insCross-referenceUsed by

CR8

And the cross references form appears

CR9

And I can now see the places in the code where it is defined when the system will post to the error account

 

 

 

 

 

 

发表我的评论
取消评论

表情

Hi,您需要填写昵称和邮箱!

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址