Hi friends, Today am going to discuss about the use of container in display method in MS dynamics AX.
There may be requirement when we need to display certain things from multiple lines in to a single field with comma separated, and it is just for viewing purpose(Sometime informative).
Let us take a quick example wherein I can show you this functionality working and code behind it!! J
In sales header you want to capture all the lines warehouses in a single field which should be separated in comma.
Am going to add display method, Just add the below code in Table > SalesTable
Display Name Warehouse()
while select salesline where salesline.SalesId==this.SalesId
for (i = 1 ; i <= conLen(warehouse) ; i++)
And then drag this particular method in SalesTable form.
And once this display method is added in to the grid, we will be able to view our scenario.Here it is:
So, the field ‘warehouse’ in header part of sales order represents the cumulative warehouse of lines.
Keep reading J