Is there any way that Navision is able to display a list of the various records (Of a particular table) that each user has open? This may make sense if I describe what we are trying to do. I’ll use the Customer table so I wont have to describe our particular modifications (they are irrelevant). In this Database, users access the “Customer” table (through the Customer Card") on a regular basis. We want to be able to open up some sort of “Customer Open” form, which will give a list of all the Customer records that are currently open, and by which user they are opened by. The only way I can conceive of this happening right now is by having code in the Customer Card, which fires when the form is opened, closed or moved from one record to the next, which stores all this information in a new table. Is there any other way? Thanks.
Actually a very similar problem was discussed last week. Unfortunately I moved the thread somewhere, and don’t know where . as a starting point, try the following code, it will give you a place to start. download - David Singleton Track Time Usage _________________________ David Singleton Navision Consultant since 1991 firstname.lastname@example.org___________
Hi Shannon, you are already so close to the solution (Making change to database as leaving form). Let’s misuse the OnQueryCloseForm trigger one more time:
**OnAfterGetRecord()** IF ("No." <> xRec."No.") AND ("No." <> '') THEN BEGIN FormCanClose := FALSE; CurrForm.CLOSE; END; **OnQueryCloseForm() : Boolean** TimeRegisterRec.CloseRecord("PreviousLogNo.", TIME); IF NOT FormCanClose THEN BEGIN "PreviousLogNo." := TimeRegisterRec.OpenRecord("No.", TIME); FormCanClose := TRUE; EXIT(FALSE); END;
Ad the following 2 functions to the Time Register table:
**OpenRecord(Record : Code;OpenTimeP : Time) : Integer** LOCKTABLE; IF FIND('±') THEN ; "Log No." ±= 1; User := USERID; "RecordNo." := Record; Opentime := OpenTimeP; Closetime := 0T; INSERT; EXIT("Log No."); **CloseRecord("LogNo." : Integer;CloseTimeP : Time)** IF GET("LogNo.") THEN BEGIN Closetime := CloseTimeP; MODIFY; END;
All records where the CloseTime is empty are currently opened by the users. There is a possibility that a record stays ‘open’ because of a network failure e.g… So it would be nice to implement a function, on a form that shows the ‘open’ records, to delete them. Best regards, Reijer Molenaar. Download TimeLogging Edited by - reijer on 2001 Oct 12 11:22:50