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

Dynamics Ax Implementing an InventDim form control

网络文摘 Kevin Roos 760浏览

Hi All,

Yesterday I was struggling a bit with an InventDim form control on a custom-made form. The problem was that the product dimension look ups were returning none or too much results like example 1. While the correct result should look like example 2.

Example 1

Example 2

The problem was that I’ve named the item field ServiceItemId instead of ItemId. This is a problem because the class InventDimCtrl_Frm_Lookup looks hard-coded for an ItemId field when you do a look up on an inventory dimension. But there is an exception, the class also looks for a method called itemId. So if you have another field or maybe have 2 item fields on the same table you can implement something like this method to return the correct ItemId.

public ItemId itemId()
{
    ;
 
    return BLOGInventDimDemoTable.ServiceItemId;
}