Immediately disable a Page component

jur
Member Posts: 8
I'm trying to disable a Field of a Page for duration of another process. I've set the Enabled property to a global Boolean variable (which also has property IncludeInDataset = Yes). Now when I set this property to FALSE, the Field doesn't immediately get disabled. It seems like this property is only evaluated when Page is idle (after all of the functions exit). But I need to set it to FALSE, do some processing and set it back to TRUE again in the same function. I've tried CurrPage.UPDATE - no luck. ](*,)
0
Comments
-
This is known "problem". But one question...But I need to set it to FALSE, do some processing and set it back to TRUE again in the same function
If I understand it correctly, you run some process and you want to set the property during this process to false and back. Isn't it useless because user will not be able to do anything during the process is running even without this?0 -
Thanks for the response. OK, here's what I'm doing:
I have a C/AL function, which uses a COM object to do some processing. That COM object pops up a dialog box, which I'd like to be modal, but couldn't find a way, as getting the handle of the active RTC window is not easy and/or reliable. So the dialog shows up and the user can do anything with the UI. That's why I chose to disable the page, so the user can't touch the UI and call more processes with dialogs. Any ideas? :roll:0 -
Than you need modal the call of the automation... it should not be so hard...0
-
All depends on how the dialog is started in the Automation. If the call of the function in automation returns before the window is closed, than the problems i there. In most cases the call of the function should end after the process in the function is finished. If it is some automation you can modify, look there... Even the MessageBox or Window in C# could be displayed as modal or non-modal.0
-
I AM showing a modal dialog in the automation object... And the automation function only returns after all the stuff is done. But the user is free to do everything he likes in the NAV UI. Oh, by the way, I should probably mention, that the C/AL function I'm calling the automation object from is OnControlAddIn. It's an add-in, that does drag'n'drop and then calls OnControlAddIn asynchronously. Then OnControlAddIn calls the automation object to do the processing.0
-
Ah, that's the problem. The addin process is not blocking the standard NAV processes. It is running in separate thread or something, because it is not considered to run some "blocking business logic". But now I understand your situation... and I have no solution for you right now...0
-
All right, thanks for replying anyway. I'm currently trying to use C/SIDE Utilities to get the active window handle, pass it to my automation object and then use it in Form.ShowDialog (.NET). I hope it works. [-o<
Edit:
Passing the window handle didn't work... The execution is completely detached from NAV. I can even close RTC and I still have the automation running, the process completes without RTC. I'll have to come up with some complex workaround in this case...0 -
OK so I'm coming back with a solution in case anyone gets into the same trap...
I'm calling ControlAddIn separately before the actual processing with an Index, indicating to disable the UI. Then the next call is the actual processing with enabling of UI at the end of the function. Pretty ugly from programmer's perspective (as many of NAV solutions), but it works and is simple.
This definitely was a lesson for me. Thanks, kine, for the input.0 -
I'm bringing this up again, as we're experiencing some errors and instability with the approach that I took (last post).
Sometimes I get this error: "An internal error has occured. Multiple concurrent calls have been issued to the server from this client."
I think this is because of two subsequent ControlAddin calls. The behaviour is really strange, looks like there are lots of problems with the synchronization between the Add-in and NAV... :-k
I've also seen some other errors and odd behaviour in area that's supposed to be really simple, synchronous and shouldn't give results that I'm getting...
Any suggestions? Tips of add-in developing, practices? Information sources about add-in and NAV communication and internals? Any help appreciated.0 -
May be the problem is, when you call the addin function from within the trigger of the addin. Try to fire the NAV event within the addin in new thread... it is just a guess...0
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