How to Automatically Insert Record in RUN Form

bob_up
Member Posts: 155
I have written a 'batch control' form for purchase invoices. The user can add, change or delete purchase invoices from this form, then post them as a batch once the total amounts add up to a batch control total.
I have added a function to form 51 'Purchase Invoice' , by which I pass the batch ID and the purchase header from the batch header form (if the user has selected to modify an existing invoice in the batch).
If the user clicks the 'Insert' option on the batch header, I would like to open form 51 in insert mode, ie as if the user had pressed F3 in that form.
Is this possible ?
I have added a function to form 51 'Purchase Invoice' , by which I pass the batch ID and the purchase header from the batch header form (if the user has selected to modify an existing invoice in the batch).
If the user clicks the 'Insert' option on the batch header, I would like to open form 51 in insert mode, ie as if the user had pressed F3 in that form.
Is this possible ?
0
Comments
-
May be you need to pass empty record to the form when running it? (or you can use SendKeys to send {F3}).0
-
is your batch form based on table 38 or is it an Form without an source table :?: If yes (based on table) and u will make it possible to add record only in form 51 you can do following.
set propertie "insert allowed" to false.
Make an menu button with Shortcut F3. Behind this, you set your source to insert an new Header.PurchHeader.init; PurchHeader."Document Type" := PurchHeader."Document Type"::Invoice: PurchHeader."No." := ''; PurchHeader.insert(true); //new No. from No Series Form.runmodal(51,PurchHeader);
Noew, if user press F3 on "batch form" the form 51 will beopend with an new No.
RegardsDo you make it right, it works too!0 -
What you can do is
On the open form trigger put this code
rec.INIT;
rec.MARK(TRUE);
rec.MARKEDONLY(TRUE);
Now you open on an empty record.
The problem is that it will be the only record visible in the Form.
Hope you can use thisRealisations are only limited by the borders of imagination0
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