Select Order Adress
elTorito
Member Posts: 191
I Make a new Order. I Select "Sell-to Customer No."
(This Customer has various Ship-to Adress List), when I Press Enter it will open a Form where i can select a "Ship To Adress".
My question is what must i do for make similar proces in Purchases & Payables, when i make new Order i select the "Buy from Vendor No."
When i press Enter i would that open a form automatically so i can select Order Adresses (if the vendor have one or more Order Adresses).
Actually we must go to the Field "Order Address Code" and Select the "Order Adress", but our sales persons forget frequently fill out this field.
Thanks.
(This Customer has various Ship-to Adress List), when I Press Enter it will open a Form where i can select a "Ship To Adress".
My question is what must i do for make similar proces in Purchases & Payables, when i make new Order i select the "Buy from Vendor No."
When i press Enter i would that open a form automatically so i can select Order Adresses (if the vendor have one or more Order Adresses).
Actually we must go to the Field "Order Address Code" and Select the "Order Adress", but our sales persons forget frequently fill out this field.
Thanks.
(Oo)=*=(oO)
0
Comments
-
Hi Eltorito,
I dont know the functionality in Standard that you are asking about, but what you are trying to do sounds simple enough.
OnAfterValidate trigger on the form of the field that you are entering (in your case "Buy From Vendor No.") enter the following code:Create variables:(global or local it does not matter) Vendship Rec Order Address (t224) VendForm Form Order Address List (F369) Code: VendShip.Setrange("Vendor No.","Buy From Vendor No."); IF VendShip.COUNT>1 THEN BEGIN VendForm.LOOKUPMODE(TRUE); VendForm.RUNMODAL; END;
That is the code for running the form, but I would assume that you dont want to stop there. So, the next part is to GET the record and paste it back to the "Order Address Code".
Your code could now look something like this:Create one more variable (try to be consistent. if you created locals, make another local etc.) CurrVendship Rec Order Address (t224) VendShip.SETRANGE("Vendor No.","Buy-from Vendor No."); IF VendShip.COUNT>1 THEN BEGIN VendForm.LOOKUPMODE(TRUE); VendForm.SETTABLEVIEW(VendShip); IF VendForm.RUNMODAL=ACTION::LookupOK THEN BEGIN VendForm.GETRECORD(CurrVendShip); VALIDATE("Order Address Code",CurrVendShip.Code); END; END;
That should give you a solution that works. Ideally it should be done at table level, but I didn't have time to debug it :oops:
Hope it helps
DeanRemember: Keep it simple0 -
Hello Dean,
In the Table 38 Purchase Header in the OnValidate Trigger from "Buy-Form Vendor No." i will be put this code and then it seem like to work so i would it:IF ("Order Address Code" = '') AND (CurrFieldNo <> 0) THEN BEGIN Vendship.RESET; Vendship.SETRANGE("Vendor No.", "Buy-from Vendor No."); IF Vendship.FIND('-') THEN BEGIN CLEAR(VendShipForm); COMMIT; VendShipForm.SETTABLEVIEW(Vendship); VendShipForm.LOOKUPMODE(TRUE); IF VendShipForm.RUNMODAL=ACTION::LookupOK THEN BEGIN VendShipForm.GETRECORD(Vendship); VALIDATE("Order Address Code", Vendship.Code); END; END; END;
Thanks for You Help !!
(Oo)=*=(oO)0 -
anytime ,Glad to help

Remember: Keep it simple0
Categories
- All Categories
- 73 General
- 73 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
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 328 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