Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Lookup/ Dropdown in Microsoft Dynamics NAV 2017

Posted on by Microsoft Employee

I have a Table called Header Requisition 

Header Requisition
No. code (10)
Employee Code Code (20) link to Employee table
Employee Name Text (50)
Requistion Date Date
Raised by code(30)
No. Series code (10) link to No. Series Table
Global Dimension 1 Code Code (20)
User code (30) link to User
Requisition Type Option (Purchase Requisition,Store Requistion)
Status Option (Open,Released,Pending Approval, Pending Prepayment,Rejected,Archived)

Global Variable

Empl Record Employee

PurchSetup Record Purchases & Payable

UsersRec Record User Setup

C/AL code of the table

OnInsert()

"Raised by":=USERID;

IF UsersRec.GET(USERID) THEN
BEGIN
IF Empl.GET(UsersRec."Employee No.") THEN
BEGIN
"Employee Code":=Empl."No.";
"Employee Name":=Empl."First Name"+' '+Empl."Last Name";
 "Global Dimension 1 Code":=Empl."Global Dimension 1 Code";
"Procurement Plan":=PurchSetup."Effective Procurement Plan";
END;
END;

"Requisition Date":=TODAY;
"Procurement Plan":=PurchSetup."Effective Procurement Plan";

Employee Code - OnValidate()

IF Empl.GET("Employee Code") THEN
 "Employee Name":=Empl."First Name"+' '+Empl."Last Name"
 ELSE
 "Employee Name":='';
 MODIFY;

In the Page I make Employee Code and Global Dimension 1 Code, Editable : False.

I want the Employee Code and Global Dimension 1 Code to picked when Login in the system. Thanks

*This post is locked for comments

  • Suggested answer
    Stefano Demiliani Profile Picture
    Stefano Demiliani 37,162 Most Valuable Professional on at
    RE: Lookup/ Dropdown in Microsoft Dynamics NAV 2017

    You have to trigger this code in codeunit LoginManagement (you can subscribe to OnAfterLogin event)

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans