Hi All! In Navision it is possible that two different user open the same order and input several lines. What i want is that if one user opens an order with for examble number ‘100000’ it should be impossible to other users to open the same order. But they should be able to open other oders with different numbers. I’ve thought about a new field in the table called “User” which should be written with USERID in the OnAfterGetRecord-Trigger of the Form. But in this Trigger i’m not able to make changes to the database. I’m working with NF 2.0, so there is no OnTimer-trigger! What is the best way to solve this Problem? Any other ideas out there? Thanks in advance! Greetings, Frank
In Sales Order Header I usually use the field Reference which is being filled with the USERID of the user currently using this order. If (Reference=’’) or (Reference=USERID) then the User is allowed to modify the order and Reference is being set to USERID. Otherwise access iss denied with message(‘This order is reserved for %1’,Reference) So far the easy part. The difficult part is to remove the UserID from the Reference (to “unlock the record” if the user leaves the Order. This has to be done OnCloseForm and also OnNextRecord as you have to deal with the fact that the user might scroll through orders using PgUp/PgDn Keys and you don’t want to end up with a situation where one user blocks all orders. You might be lucky if you can say from the beginning: “The person who created an order is the owner and nobody is allowed to touch it”. In this case you can assign the reference OnInsert and can start with a Filter OnOpenForm() SETFILTER (Reference, STRSUBSTNO (’%1|%2’,’’’’’’,USERID)); ------- With best regards from Switzerland Marcus Fabian
Hi Marcus thanks for your reply! I’m not in the Situation to set a filter in the onOpen-Trigger as all users must see (not edit) all orders. And if i want to build the same situation with my own individual tables where do i have to fill the special field with USERID? Greetings, Frank
This is possible but not normal situation. Also this is very rare problem (mostly based on bad organization of process). The best solution is “DO NOT EDIT ONE RECORD AT SAME TIME BY MORE THAN ONE USER”. Business Applications Programmer Sertified Navision Developer SIA “Sintegra” Latvia
Be careful with OnNextRecord. While this trigger fires when scrolling from record to record or using PgUp/PgDn keys, it does not fire when moving to a new record when selecting from a list.