A relation may be created on an Extended Data Type in the same manner it is created for a field existing in a table
Relations no only serve to enforce business rules in AX, they are used for other important tasks, such as:
- Creating auto joins in forms
- Looking up values in other tables (Using lookup list/selection list boxes and the Go to Main Table command)
- Validating data by providing constraints
- Automatically propagate changes from on table to another by defining cascading relations
- Generating TooTips
- Auto defining relations in queries
Now lets step-by-step to create lookup list based on task 2:-
1. Create Table Information with EmployeeId and PositionGrade fields.
2. Right click Information table, select properties. set the TitleField to the Field that you plan to show in look up.
3. Create Table TestingInfo with EmployeeId fields
4. At Table TestingInfo, select Relation and set the relation with Information table. Validate Must set to YES for lookup list
5. Set the Relation between TestingInfo.EmployeeId and Information.EmployeeId
6.Use the same method, create a new Forms Group under the project. Set the name as EmployeeInfo, drag and drop the Information Table from Tables Group to Data Sources of the EmployeeInfo. After that select Designs->Design, right click and select New -> Tab, and add 2 tab pages in the Tab, named the 1st tab page as Overview, and 2nd tab page as General. Then select the 1st tabl page and add a grid under it. Drag and drop the data fields from Data Source to the Grid and 2nd Tab Page
7. Save the change and right click the EmployeeInfo, select Open to insert data as Ctrl + N.
8. Create a new Form under the Form Group and name it as TestingInfo. Drag and drop the TestingInfo Table to the Data Source, after that drip and drop the EmployeeId field to design.
9. Done!!