2 questions about storing one value of one field

  1. I need to have a default “AccountId” field on the form.

It has to be saved somewhere so I created a table for it. The table has one record. When a user changes the value of this field on the form, the value of the field in the table also changes.

Technically it does its job. But is this approach professional? Optimal?

I’m asking because I shouldn’t need to create a table for this, I need to save only one value of one field. I have a feeling that this approach isn’t the right one. What is another way of doing this?

  1. This question is also about the “AccountId” field. I need to have a dropdown of the field “AccountId” in my table. I don’t need any filters. This field must be able to store any value from the table “Account”. So when inserting a new record, a dropdown must be shown showing all values from the table “Account”.

I accomplished it but is this the correct way?

I just dragged the field “AccountId” from the table “Account” to my table, the result is what I hoped for, it works. But my table doesn’t even have a datasource, just one field which has DataSource property filled. Is this the correct way to do it?

Where else do you want to store the value? The database is the right place in 99%. Whether you should create a new table or add the field to an existing table (such as module’s parameters) depends on the purpose of the field.

Using the extended data type is the correct way.

I don’t follow your last question - for instance, the sentence “my table doesn’t even have a datasource” doesn’t makes sense.

Consider reading training materials for developers, Inside Dynamics AX and documentation on MSDN. Otherwise you will waste a lot of time trying to figure out basics of AX development.

Thank you for your reply. Yeah, that sentence doesn’t make sense, I agree. I thought I was talking about s form, I messed it up. Thanks again.