How to add fields to the form DirPartyQuickCreateForm?
Views (505)
Hello AX World,
I have spent almost a day desperately searching for a way to add new fields to the form DirPartyQuickCreateForm. This is a general purpose form used to create new customers, contact persons or prospects.
Root data source is instantiated based on the caller. Some fields are common as they relate to DirParty framework some fields are dynamically added and it was not so obvious how they are added. In this case, fields Prospect, Type ID, Currency, Delivery terms and Mode of delivery are dynamically added fields.
If you take a closer look at the design, you can notice that there are two groups DynamicHeader and DynamicDetail that suggest it is dynamically populated.
Then I searched for where it was used and found addDynamicControls method. Well, quite obvious as I explain now. The problem was that I somehow missed the details of it and thought it just creates the groups. So I left it behind and continued searching for another place where the fields could have been added and that was a mistake. I am not going to get into details of that as it's not relevant. Instead, I will focus on this method as it's the key.
So you can notice the groups DynamicHeader and DynamicDetail used here. In this method the groups are set a data source and the data group and this had finally clicked me. Once the data source is instantiated it assigns a group which must exists on the data source. I looked up the table I knew used and Voila! it was there.
Simple metadata search and you can find all tables used in this form.
type:table,tablefieldgroup quickCreateDetails
Once the field have been added to this group in a table extension it was also visible in the form as well.
This also tells a good example (debatable) of form development, how the fields could be added dynamically and yet would be sort of easily extensible.
Be aware and take care!
I have spent almost a day desperately searching for a way to add new fields to the form DirPartyQuickCreateForm. This is a general purpose form used to create new customers, contact persons or prospects.
If you take a closer look at the design, you can notice that there are two groups DynamicHeader and DynamicDetail that suggest it is dynamically populated.
Then I searched for where it was used and found addDynamicControls method. Well, quite obvious as I explain now. The problem was that I somehow missed the details of it and thought it just creates the groups. So I left it behind and continued searching for another place where the fields could have been added and that was a mistake. I am not going to get into details of that as it's not relevant. Instead, I will focus on this method as it's the key.
So you can notice the groups DynamicHeader and DynamicDetail used here. In this method the groups are set a data source and the data group and this had finally clicked me. Once the data source is instantiated it assigns a group which must exists on the data source. I looked up the table I knew used and Voila! it was there.
Simple metadata search and you can find all tables used in this form.
type:table,tablefieldgroup quickCreateDetails
Once the field have been added to this group in a table extension it was also visible in the form as well.
This also tells a good example (debatable) of form development, how the fields could be added dynamically and yet would be sort of easily extensible.
Be aware and take care!
This was originally posted here.
*This post is locked for comments