Displaying the name of the ID value on a form

asembereng
Member Posts: 220
I want to store the ID value of reference table to another table but i want the form to display the actual name instead of the ID number.. For example, I want store the department ID on an employee table but on the employee card it should display the name of the department.. Any idea please?
0
Comments
-
Lookup the usage of flowfields. Maybe Lookup would be the function of the flowfild...0
-
I am using the lookup function but it stores and display the ID; eg. 1 for the department name IT department.. What i want is to store the department ID but displays the department name. The user will see the department name instead of seeing the department ID.0
-
You have a "Real" field that has a table relation to another table's ID field. When you look that up it gets filled with the ID. You add a new field (not a real Field in SQL database) and you set the Class to Flowfield and it's function to be something like: Lookup Department.Description where Department.ID = field(ID). If you use the Assist edit button you just have to fill the values...0
-
Change the FieldCLass to FlowField and then set the CalcFormula... I don't have it in front of me now to get a screenshot...0
-
I tried that and i am having some data type errors. Anymore idea on what to or am i doing it wrongly?0
-
Can you show us what you did?0
-
Probably at the card form do not use the actual field of the table. Instead use a function [return type as text] as a source expression of the 'text box' that will return the name, of the ID that you have coptured at the table level.
But you should try avoiding using this at the list form, as it may degrade performance. It also cannot be used for filtering data.
Hope this helps./PDR0 -
ok can you explain, i am pretty confuse now.. Would you mind giving me example.. like coding it?
Thanks0 -
are there seperate fields for the ID name & id Code or are you trying to get the name FROM the ID Code?
If it's store seperately
ID -- Name
1 -- Some Name
2 -- Some Other Name
then the flowfield would look like
Method=Lookup
Table=table that has the ID name & Code
Field = Id Name
Table Filter= ID Code = Salesperson.ID Code0 -
I want store the department ID on an employee table but on the employee card it should display the name of the department0
-
Yes i have a table called department with fields ID and Department_name. On the employee table there is a foreign key for the department_ID which stores the ID but i want the user to see the department name even though the department ID is stored.0
-
In Employee Table Add:
1) Normal field, DepartmentID, type = the type of the field in the department table.
2) Flowfield, DepartmentName with CalcFormula = Lookup(Department.Name WHERE (ID=FIELD(department_ID)))
On the form reveal both fields. When the user fills the departmentID field the DepartmentName field is calculated Automatically.
After that, if you want you can remove the department_ID from the form and create some lookup code on the OnLookup code of that field that will actually fill the DepartmentID field..0 -
kapamarou wrote:On the form reveal both fields. When the user fills the departmentID field the DepartmentName field is calculated Automatically.0
-
2) Flowfield, DepartmentName with CalcFormula = Lookup(Department.Name WHERE (ID=FIELD(department_ID)))
Ok should this be on the employee table? Am i going to create another field called DepartmentName on the employee table? Because i only want to store the ID on the employee table and yet display the departmentname on the card.0 -
asembereng wrote:
2) Flowfield, DepartmentName with CalcFormula = Lookup(Department.Name WHERE (ID=FIELD(department_ID)))
Ok should this be on the employee table? Am i going to create another field called DepartmentName on the employee table? Because i only want to store the ID on the employee table and yet display the departmentname on the card.0 -
Now i am getting the name to display on a text field using:
dept.get("department id");
deptname := dept."department name";
on onAfterValidat() trigger.
My problem is if i move to the next employee the departname does not change unless i select it again. Is there any possible way that the text field moves whenever i clicked on the next employee?0 -
I am also getting an error saying department id 0 does not exist. I when to the department table but there was no zero id.. I am wondering where is this zero id coming from.0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions