One instance of running form per base

kvb
Member Posts: 107
Hi all,
is there in Nav table where i can get information about quantity of existing instances of any object(for example form)?
thanx in advance
is there in Nav table where i can get information about quantity of existing instances of any object(for example form)?
thanx in advance
0
Comments
-
no there isn't...
but you can make it several ways:
make new table: (FormID, Counts)
in your form:OnOpen you just read the record fro new table, increase counts
On Forms OnClose you read again and decrease number.
you can use locking and comitting to ensure correct counts...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
you can also make it without new table by using singleinstance codeunit,
On open form you try to run this codeunit (if it isn't already runing) and then you just increase some counter variable...
Form:OnClose you decrease counter...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
With the single instance codeunit you can only see the number of instances on the current client. Not on all clients.In a world without Borders or Fences, who needs Windows and Gates?0
-
:oops: oops, i missed it. so it's only first way to go...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
thanx for replies, guys
RobertMo, in case of abnormal error OnClose trigger will not run.
So, we will have wrong data in our new table. It`s unsuitable for me.0 -
Yeah, well too be honest if we have to take in account that abnormal errors can occur i think every sollution you try will not be suitable in some way.
You can always build a monitoring tool wich scans all the window handles below "Fin.exe". But you will only be able to get the window captions with that, no object ID.In a world without Borders or Fences, who needs Windows and Gates?0 -
add a filed userid, so you have <userid><formid><count>.
when updating counter for a user on OnOpen form, you can allways run a function that checks if some user is not conected (crashed) and you fix his count (delete rec for userid's that are not conected)
it is not perfect, but...®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
and you should write such code that application doesn't crash.
believe me user we'll be happy too®obi
¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯¯0 -
RobertMo wrote:add a filed userid, so you have <userid><formid><count>.
when updating counter for a user on OnOpen form, you can allways run a function that checks if some user is not conected (crashed) and you fix his count (delete rec for userid's that are not conected)
it is not perfect, but...
good idea, i wrote this function before you say to do it 8)
but i run it from LogInStart function in the Codeunit 10
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