NAV 2009 R2 RTC - Default Transfer Order Location
mib_usr_vao
Member Posts: 12
Dear all,
I am trying to to set default Transfer-from and Transfer-to Locations on the Transfer Order Card on New Page or New Record; I also want to validate these values.
What I have tried so far is to add Transfer-from and Transfer-to lookup (to Location table) fields in the User Setup table, hence pointing each user to his/her default location. Then, I have written
vUserSetup.RESET; //introduced the User Setup table as a variable
vUserSetup.SETFILTER(vUserSetup."User ID",'%1',USERID);
IF vUserSetup.FINDFIRST THEN BEGIN
"Transfer-from Code":=vUserSetup."Transfer Location-from";
VALIDATE("Transfer-from Code",vUserSetup."Transfer Location-from");
END;
The code was entered either OnInsert() of the Transfer Header table or the Transfer Order page. In the first case I get an "Transfer Header No. 'XXXX' does not exist" error, in the second I get the value inserted by with no validation.
Any help is really welcomed, thank you very much in advance
I am trying to to set default Transfer-from and Transfer-to Locations on the Transfer Order Card on New Page or New Record; I also want to validate these values.
What I have tried so far is to add Transfer-from and Transfer-to lookup (to Location table) fields in the User Setup table, hence pointing each user to his/her default location. Then, I have written
vUserSetup.RESET; //introduced the User Setup table as a variable
vUserSetup.SETFILTER(vUserSetup."User ID",'%1',USERID);
IF vUserSetup.FINDFIRST THEN BEGIN
"Transfer-from Code":=vUserSetup."Transfer Location-from";
VALIDATE("Transfer-from Code",vUserSetup."Transfer Location-from");
END;
The code was entered either OnInsert() of the Transfer Header table or the Transfer Order page. In the first case I get an "Transfer Header No. 'XXXX' does not exist" error, in the second I get the value inserted by with no validation.
Any help is really welcomed, thank you very much in advance
0
Comments
-
You can reduce your code as follow, customizing only the table (no need to touch the page):
IF vUserSetup.GET(USERID) THEN VALIDATE("Transfer-from Code",vUserSetup."Transfer Location-from");
Can you please ensure you added your code at the end of OnInsert table trigger, after this 2 statements?InitRecord; VALIDATE("Shipment Date",WORKDATE);* Daniele Rebussi * | * Rebu NAV Diary *0
Categories
- All Categories
- 75 General
- 75 Announcements
- 66.7K Microsoft Dynamics NAV
- 18.8K 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
- 610 NAV Courses, Exams & Certification
- 1.9K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 251 Dynamics CRM
- 103 Dynamics GP
- 6 Dynamics SL
- 1.5K Other
- 991 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 28 Design Patterns (General & Best Practices)
- Architectural Patterns
- 9 Design Patterns
- 4 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1K General Chat
- 1.6K Website
- 77 Testing
- 1.2K Download section
- 23 How Tos section
- 249 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions
