Bojensen Blogs

Adding only one Dimension in Dialog – Axaptapedia

Warning: This patch did not work for me in Axapta 3.0. It for sure correctly creates the dialog field, but you are unable to actually set the value for it. Having the Dimension[2] field appended as outlined below results in runtime errors when trying to fill in a value into the field (f.x. during the putToDialog called after unpack()). I have not had time to investigate this further, however, it seems to me that the array index display would need to be added to the DialogField’s runtime state and then taken into account when setting / getting the value.


To add new field in dialog we use addField() method. When we try to add for example Dimension field Axapta adds all the fields automatically. But sometimes we need to add only one particular field.

Idea

To solve this problem we just need to pass array index as parameter.

Solution

1. Add into Dialog class addField() method another one parameter:

 

2. Add into DialogField class init() before while (f <= arraysize) loop following lines:

Here we add necessary field.

3. Now we may add in dialog only one necessary field:

4. You can use only standart:

Adding only one Dimension in Dialog – Axaptapedia

Comments are closed.