Access field from other page

TheHitman123
Member Posts: 12
I am a newbie trying to change NAV as follows:
Some of my users must be able to "Ship and Invoice" at all times except when a sales order is marked to restrict invoicing.
The changes I made was on the Sales Header I added a boolean to mark it as a "special" order. In these cases the system must not allow the user to ship and invoice, only to ship. A flag was added to User Setup as well to mark the users that should sometimes be restricted.
Then the idea was to test if the correct situation exists to block invoicing, the problem is however that once you click Post and Print it executes a codeunit and my license does not allow changing codeunits. I was therefore thinking of resetting the Qty to Invoice field to zero which will trigger NAV's validation on invoicing zero quantity. I was also thinking of putting the code for this on the page action to Post and Print directly in front of the code that calls the codeunit.
Being a newb, I do not know how to address the Qty to Invoice field at this point since it is in a different page part. (The sales lines).
Is there anyone who can help me with this code, basically once I tested for the correct situation which I know how to do, what code can reset the Qty to Invoice on all lines to zero.
Regards,
Some of my users must be able to "Ship and Invoice" at all times except when a sales order is marked to restrict invoicing.
The changes I made was on the Sales Header I added a boolean to mark it as a "special" order. In these cases the system must not allow the user to ship and invoice, only to ship. A flag was added to User Setup as well to mark the users that should sometimes be restricted.
Then the idea was to test if the correct situation exists to block invoicing, the problem is however that once you click Post and Print it executes a codeunit and my license does not allow changing codeunits. I was therefore thinking of resetting the Qty to Invoice field to zero which will trigger NAV's validation on invoicing zero quantity. I was also thinking of putting the code for this on the page action to Post and Print directly in front of the code that calls the codeunit.
Being a newb, I do not know how to address the Qty to Invoice field at this point since it is in a different page part. (The sales lines).
Is there anyone who can help me with this code, basically once I tested for the correct situation which I know how to do, what code can reset the Qty to Invoice on all lines to zero.
Regards,
0
Comments
-
Hey Hitman,
First of all, i hope you dont want to apply this change to a productive System, because it's really, really, REALLY ugly.
This should be changed in CU80 | CU81. I suppose you are some kind of student who doesnt have a DEV License. If not contact your NAV Partner for that change.
However, if you really want to do this, some pseudocode may help you:SalesLine.Setrange(type, headertype); salesline.setrange(document no, headerno); if salesline.find('-') then repeat salesline.validate("qty. to invoice".0) salesline.modify(true); until salesline.next = 0;
Austrian NAV/BC Dev0
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