Dialog window and subform refresh

Dakkon
Member Posts: 192
I have a form with a header section and a subform with lines on it. On this form is functionality for the user to hit a specific key to be prompted with a dialog so that they can scan a series of barcodes until they are done (at which point they just hit escape). My problem is that I have found no way to make my form or more importantly the subform refresh after each scan. Here is my code:
(Reader is a dialog window and AddItemByUPC() is a function that adds an item line based on the scanned UPC code)
The issue here is that I need each item added to the subform lines to appear after it is scanned. Currently, nothing actually refreshes until the user hits escape, and then all of the new lines suddenly appear. I tried changing the code to something like the following too:
but that didn't seem to work either. Does anyone have any ideas?
(Reader is a dialog window and AddItemByUPC() is a function that adds an item line based on the scanned UPC code)
Reader.OPEN('Waiting for UPC Barcode Scan...\#1###################'); WHILE (TRUE) DO BEGIN UPC := ''; Reader.INPUT(1,UPC); AddItemByUPC(UPC); COMMIT; END; Reader.CLOSE;
The issue here is that I need each item added to the subform lines to appear after it is scanned. Currently, nothing actually refreshes until the user hits escape, and then all of the new lines suddenly appear. I tried changing the code to something like the following too:
WHILE (TRUE) DO BEGIN UPC := ''; Reader.OPEN('Waiting for UPC Barcode Scan...\#1###################'); Reader.INPUT(1,UPC); Reader.CLOSE; AddItemByUPC(UPC); COMMIT; CurrForm.UPDATE; END;
but that didn't seem to work either. Does anyone have any ideas?
Thad Ryker
I traded my sanity for a railgun
I traded my sanity for a railgun

0
Comments
-
Have tried changing one of your lines to:
CurrForm.UPDATE(false);
Regards,
gus0 -
You will maybe need to user the OnTimer trigger on the main form. Search the forum with the word OnTimer."Real programmers don't comment their code.
If it was hard to write, it should be hard to understand."0 -
Insert this after the imput to give the chance to OS update application windows etc... and don't forget to call CurrForm.UPDATE.
YIELD;
0 -
I really thought the YIELD command would be the ticket but it didn't work. I've tried CurrForm.UPDATE() with FALSE and TRUE parameters. I've tried closing the dialog in the loop before calling update and yield and then reopening it at the start of the loop. In short I've tried just about everything you suggested and that I can think of. The OnTimer results in the same problem. So far nothing seems to actually refresh the subform until the code ends. I really appreciate all the ideas so far
..any others?:)Thad Ryker
I traded my sanity for a railgun0 -
Do not use Imput but some form and code insert into OnValidate or OnAfterValidate.0
-
If I run the form in modal mode like I'd need to, I don't think it would update but I'll try it as last resort. The other problem I'd have with the form is that my users are not very computer literate, and they insist on running windows maximized, which will in turn maximize the popup window (and regardless of how much I explain I'm sure I'd get repeated calls of "I can't see the sales screen anymore!"). Is there a way to do a popup modal form in Navision that won't maximize even if the other windows and the app are already maximized?Thad Ryker
I traded my sanity for a railgun0 -
I think no.
And another solution - include the textbox for entering the code directly on the form where you have the lines and set NextControl to same control. After entering you will have active the same textbox for next imput...0 -
Good call, that should just fine. I'll just create a textbox and make it invisible. Then when they hit the hotkey to enter scan mode, I'll just make the box visible and set focus to it :PThad Ryker
I traded my sanity for a railgun0 -
If someone does manage to find a way to make a subform refresh during this scenario I'd still be interested in hearing about itThad Ryker
I traded my sanity for a railgun0
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