I have a Table called 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