Skip to main content

Notifications

Microsoft Dynamics RMS forum

Two Batches in Offline Database

Posted on by 65

For some reason I have a POS terminal that has 2 batches in the Offline Database.  I tried updating the primary database but it will only import the last batch.  Luckily, before attempting the primary database update I backed up both offline and the primary databases.  Is there any way to synch both batches to the primary database?

*This post is locked for comments

  • RMS Goddess Profile Picture
    RMS Goddess 170 on at
    RE: Two Batches in Offline Database

    Thank you for posting such detailed instructions.  Had a similar issue and worked like a charm.  Slightly different registry key path for a 64 bit system but the rest was perfect!

  • Nikk Profile Picture
    Nikk 65 on at
    RE: Two Batches in Offline Database

    Thank you Stef.  I'm hoping this is the solution to my problem.  I will forward this on to Microsoft support and keep my fingers crossed.

  • Nikk Profile Picture
    Nikk 65 on at
    RE: Two Batches in Offline Database

    Thank you so much Hassan.  That's a very detailed and well written report you have.  Microsoft hasn't been able to fix my problem for 2 months now.  I'm hoping this will give us some insight on how to resolve the issue.

  • Stef Rose Profile Picture
    Stef Rose 240 on at
    RE: Two Batches in Offline Database

    I will give you some code writing directives and you should ask your business programmor to understanding and applying them. In the cas you do not have this ressource, please post again.

    First you should merge your two batches of datas to simplify merging to your terminal database as :

    var1 = secondaryDatabase;

    try (merge batche1 && batche2) if

        batche1 != batche2        // saving time for a redondant task of double writed batches and datas

    catch (batche1 && batche2 = var1);

    try (merge secondaryDatabase && primaryDataBase) if    

        secondaryDataBase != PrimaryDataBase                    // secondaryDataBase = var1  

    catch ( primaryDataBase ++);  // primaryDatabase is equal to itself and its implementation

    Your local programmor should understand that he could use these code lines for databases implementation and sould create you an API for management of such databases modifications, that allow you an easier way to manage yourself these problematic cases. For any further technical advices, please post again.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Two Batches in Offline Database

    I have created the below document long long time ago for my own reference, please read it and I'm sure it will help you solving the problem, u will need to change the registry keys and paths to the correct ones

    Offline Definition: -

    Offline mode means that there’s a network or server failure preventing a POS machine from connecting to the store database and therefore the POS machine connects to a local database that has the necessary information to post transactions, this local database is called the offline database and it’s being synchronized every time a Z report is generated.

    How a POS machine goes offline: -

    While a POS machine is working in normal mode (on the main database on the server), a server or network failure might occur. In that case, the POS application will generate a run time error and the application will exit unexpectedly. When the cashier tries to re-open the POS application, the following scenario will be applied: -

    1. The POS application will try to connect to the server main database within the pre-configured ‘Connect Timeout’ in the Store Operations Administrator (which is 15 seconds in our implementation)

    2. The application will then try to connect to the pre-defined offline database (which is usually stored locally in our implementation though it might not) within the pre-defined ‘Connect Timeout’ for the offline database in the Store Operations Administrator.

    3. The POS application will supposedly succeed in connecting to the offline database (if it’s properly configured).

    4. The POS application will display a message telling that it’s working in offline mode and will change the “TerminalOffline” flag in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Retail Management System\Store Operations\POS User\ from ‘False’ to ‘True’ stating that the application is working offline.

    5. The POS application will keep working offline and will not sense by itself that the network or the server comes up.

    6. Any POS user who has the right to exit the application should close the POS application and re-open it.

    7. The POS application will check the main database (it does this every time u open it) and will be able to connect to it since the network and the server are up

    8. The POS application will check the “TerminalOffline” flag too to know if there are some transactions to upload or not.

    9. The POS application will find the “TerminalOffline” flag set to ‘True’ and therefore will display a message stating that the main database in back online and will ask about restoring the offline transactions to the main database.

    10. If the cashier presses ‘No’, nothing new will happen and the POS application will continue working offline.

    11. If the cashier presses ‘Yes’, the POS application will upload the offline transactions to the main database (if any kind of failure in server or network occurs while uploading transactions, the application will upload the uploaded transactions again resulting in transactions’ duplication).

    12. After the POS application uploads ALL the transactions, it will change the “TerminalOffline” flag in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Retail Management System\Store Operations\POS User\ from ‘True’ to ‘False’ stating that the application is not working offline anymore.

    13. The POS application is working now online and all the offline transactions have been uploaded to the server just waiting for the blind closed batches to be closed.

    What happens if the POS machine goes offline without having access to edit the registry?

    This typically happen when the user is a normal user

    1. The POS application will try to connect to the server main database within the pre-configured ‘Connect Timeout’ in the Store Operations Administrator (which is 15 seconds in our implementation)

    2. The application will then try to connect to the pre-defined offline database (which is usually stored locally in our implementation though it might not) within the pre-defined ‘Connect Timeout’ for the offline database in the Store Operations Administrator.

    3. The POS application will supposedly succeed in connecting to the offline database (if it’s properly configured).

    4. The POS application will display a message telling that it’s working in offline mode and will TRY to change the “TerminalOffline” flag in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Retail Management System\Store Operations\POS User\ from ‘False’ to ‘True’ but unfortunately will fail in changing this registry value (BUG).

    5. Instead of informing the user about failure in changing the registry value, the POS application will work offline without changing the registry value that’s a must to know its status and therefore resulting in unexpected behavior afterwards.

    6. The POS application will record its transactions locally in the offline database while working offline although the registry value “TerminalOffline” is still ‘False’.

    7. When the network and server are back up. Any POS user who has the right to exit the application will close the POS application and re-open it.

    8. The POS application will check the main database (it does this every time u open it) and will be able to connect to it since the network and the server are up

    14. The POS application will check the “TerminalOffline” flag too to know if there are some transactions to upload or not.

    9. The POS application will find the “TerminalOffline” flag set to ‘False’ (this shouldn’t happen) and therefore will do nothing except working normally in online mode as if it was never in offline mode (the POS application doesn’t know in this case that it was in offline mode).

    10. The offline transactions will not be uploaded to the main database and there will be no blind closed batches.

    How to resolve a POS machine going offline then back online without sending its sales to the main database?

    1. Exit the POS application

    2. Logoff windows and logon as Administrator or any other user who has access to edit the registry.

    3. If the application opens by itself (in the startup for example), close it.

    4. Open the registry (regedit.exe).

    5. Change “TerminalOffline” flag in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Retail Management System\Store Operations\POS User\ from ‘False’ to ‘True’

    6. Verify the records to be uploaded in the [Transaction] table using ‘SELECT’ statement affecting the offline database.

    7. State the Register number from the registry from  HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Retail Management System\Store Operations\POS User\Register\Number

    8. Run an ‘UPDATE’ statement on the Register.CurrentBatchNumber to change the value of this field for the intended register only in the offline database and make its new value the same as the BatchNumber previously selected in the pre-executed ‘SELECT’ statement (Only 1 row will be affected).

    9. Open the POS application, it will display a message stating that the main database in back online and will ask about restoring the offline transactions to the main database.

    10. Press ‘Yes’

    11. The offline transactions will be uploaded to the main database.

    12. Exit the POS application.

    13. Logoff Windows and logon using the normal Windows account.

    14. Make sure to give the intended Windows account the proper privileges to edit the “Sales Management Systems” key in the registry using Group Policy or even Local Security Policy.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Give Back to the Community this Month

Quick Links

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,802 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 229,133 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,154

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans