Auto populate data in a field on a page.

mysamza
Member Posts: 66
I have a table with the following fields;
fields
{
field(1; "Document Nos."; Code[20])
{
}
field(2; Employee; Code[10])
{
TableRelation = Employee;
}
field(3; "Pay Code"; Code[10])
{
}
field(4; Currency; Code[10])
{
}
field(5; Amount; Decimal)
{
}
field(6; "Posting Date"; Date)
{
}
field(7; "Employee Name"; Text[50])
{
}
}
The Employee field is a lookup to the Employee table. Notice the field Employee Name (field 7)
Once the user selects an Employee from the Lookup, I want the Employee name to populate with the value of Employee Name from the Record user selected in the Employee (field 2)
I am omitting the code for the Card Page for this table as it is straightforward. Just has the same amount of fields that are in the table I posted above.
I look for a hint as to how do I go about achieving this.
Thanks a lot in advance for the help.
fields
{
field(1; "Document Nos."; Code[20])
{
}
field(2; Employee; Code[10])
{
TableRelation = Employee;
}
field(3; "Pay Code"; Code[10])
{
}
field(4; Currency; Code[10])
{
}
field(5; Amount; Decimal)
{
}
field(6; "Posting Date"; Date)
{
}
field(7; "Employee Name"; Text[50])
{
}
}
The Employee field is a lookup to the Employee table. Notice the field Employee Name (field 7)
Once the user selects an Employee from the Lookup, I want the Employee name to populate with the value of Employee Name from the Record user selected in the Employee (field 2)
I am omitting the code for the Card Page for this table as it is straightforward. Just has the same amount of fields that are in the table I posted above.
I look for a hint as to how do I go about achieving this.
Thanks a lot in advance for the help.
0
Answers
-
trigger OnValidate()
begin
...
end;
You can add an OnValidate Trigger in your Employee field.
The OnValidate Trigger will get triggered after you enter a value to a field.0 -
Also decide if you want the field to be a flowfield, or if the users should be able to edit it after it has been populated.Don't just take my word for it, test it yourself0
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