Sage 100

 View Only
Expand all | Collapse all

Custom Office update "File in use"

  • 1.  Custom Office update "File in use"

    Posted 03-08-2025 16:16

    Trying to add a new UDF to AR_InvoiceHistoryHeader and AR_OPenInvoice while everyone is off the system this weekend.

    Keep getting that those files are in use.

    Have rebooted the server, stopped the Adv service and run Sage in MAS90 mode, cleared the SY_LockFileInfo.M4T file. 

    What am I missing? They have Avatax and credit card processing.

    Can I rename the Links file without screwing anything up just long enough to update the file (if that even helps)?



    ------------------------------
    Beth Bowers
    (269) 358-0989
    ------------------------------


  • 2.  RE: Custom Office update "File in use"

    Posted 03-08-2025 16:56

    Any other outside processes like Excel or other connector could be open that is reading the file?



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 3.  RE: Custom Office update "File in use"

    Posted 03-09-2025 07:54

    We had that. I belive it was repay causing the lock. We renamed the links folder and it goes through. 



    ------------------------------
    Russell Berman
    SAGE 100 Reseller
    Business Solutions Providers
    Hackensack
    ------------------------------



  • 4.  RE: Custom Office update "File in use"

    Posted 03-09-2025 09:35

    Beth, it seems that I have to do that more and more in the last couple of years (rename Links). I'm not sure why since that has never been a problem in past years.



    ------------------------------
    Amber Prayfrock, Blytheco
    ------------------------------



  • 5.  RE: Custom Office update "File in use"

    Posted 03-09-2025 09:42
    I'm finding that if MAPADOC is installed, to add UDFs in AR the Links folder needs to be temporarily renamed. Does appear to cause any problems. 

    Myron Stevenson, Consultant
    Clearis Consulting, Inc.
    direct phone: 218.525-6720
    1420 Morningside Ave, Duluth, MN 55803
    Myron@clearisconsulting.com





  • 6.  RE: Custom Office update "File in use"

    Posted 03-09-2025 10:33

    Agreed on renaming links folder.  Do it while you run the update and then name it back.  I have found the same thing with InSynch. 



    ------------------------------
    Bob Osborn
    Senior Consultant
    DSD
    7142645278
    ------------------------------



  • 7.  RE: Custom Office update "File in use"

    Posted 03-09-2025 12:06

    Thanks for the "OK", everyone.  That did the trick.  The client has Avatax and eBiz Charge only, so it's one of those two that caused the issue this time.



    ------------------------------
    Beth Bowers
    (269) 358-0989
    ------------------------------



  • 8.  RE: Custom Office update "File in use"

    Posted 03-09-2025 11:09

    This seems to be a perennial problem.  Why are UDFs different than when enhancements are installed (if this IS the issue)?  This should have been resolved ages ago.



    ------------------------------
    Jeff Schwenk
    Owner
    Bottomline Software, Inc.
    Waynesboro VA
    (540) 221-4444

    Improving bottom lines for over 25 years!
    ------------------------------



  • 9.  RE: Custom Office update "File in use"

    Posted 03-10-2025 00:26
    Edited by Alnoor Cassim 03-10-2025 02:40

    Speaking with my MD hat on. This explanation will 99% not make sense and be clear as mud but here goes.

    When an MD adds code in their override for an update program, such as SO_SalesJournal_upd.pvc, and when that includes instantiating a business object (for those of you who script, this is called GetObject or NewObject for the purpose of writing or reading to a different file/table), and the MD does that bit in what's called the ON_CREATE block of their override program, which sets initial variables and connections in their program, well that creates a read/write connection (instead of a read-only one) to the primary data file/table involved with that business object. This is only a problem only when we click Update in UDF Maintenance.

    Using Beth's example of where she's sourced a AR_InvoiceHistoryHeader UDF from AR_TransactonPosting (which is the S/O Sales Journal Update), it will actually instantiate SO_SalesJournal_upd.pvc by design. That means if there's a MD override for it and their ON_CREATE block instantiates AR_Customer_bus as an object (as opposed to AR_Customer_svc), this creates the read/write connection to AR_Customer.m4t table/file.

    Normally not an issue. However, UDF Maint during its update, will at some point want exclusive access to AR_Customer.m4t which it does not have now and so you get the "file in use". Had the MD instantiated the service object AR_Custormer_svc instead of AR_Custormer_bus, it would've create a read-only connection (akin to being in Customer Inquiry) which would not cause the "in use" msg. However, in this example the MD needs to write back to AR_Customer during the Sales Journal Update as part of their requirements, so they have to use AR_Customer_bus.

    ** A solution might be for the MD to not instantiate AR_Customer_bus (or whatever the _bus is) if they detect the StartProgram (as it's called) as CM_UDFMAINT_UI. Sage engineers should give the MDs some official guidance on this too as this issue has been around since Day 1 of Business Framework.



    ------------------------------
    Alnoor Cassim
    Accounting Systems, Inc. (ASI)
    ------------------------------



  • 10.  RE: Custom Office update "File in use"

    Posted 03-10-2025 02:39

    @Alnoor Cassim If KnowledgeSync, Excel / F9 or other external program has an open connection to AR_Customer.m4t ( per your example), would the error occur?  Because these would be read only connections they shouldn't cause the exclusive access error? 



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 11.  RE: Custom Office update "File in use"

    Posted 03-10-2025 02:47

    Doug you are correct those situations wouldn't cause the "in use" error. Any external app that uses ODBC is by definition a read-only connection. Now if the external app uses BOI, then if they're using AR_Customer_svc, they're still fine. But if it uses AR_Customer_bus because it needs to write back data, and the app is actively running at the same time you are updating UDFs, then we have a problem.



    ------------------------------
    Alnoor Cassim
    Accounting Systems, Inc. (ASI)
    ------------------------------



  • 12.  RE: Custom Office update "File in use"

    Posted 03-10-2025 02:49

    Makes sense.  Thanks Alnoor!



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 13.  RE: Custom Office update "File in use"

    Posted 03-10-2025 06:55

    So, @Alnoor Cassim - I'm curious.  I had stopped the Sage service (this was on Adv) and was running Sage 100 in MAS90 mode.  I still got the error, until I renamed Links. Were the Credit Card and Avatax mods "actively running", in that instance?



    ------------------------------
    Beth Bowers
    (269) 358-0989
    ------------------------------



  • 14.  RE: Custom Office update "File in use"

    Posted 03-10-2025 07:30

    I wonder if the Paya Connect Desktop was stopped if the error would appear.



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 15.  RE: Custom Office update "File in use"

    Posted 03-10-2025 11:38

    @Beth Bowers - No eBiz CC and AvaTax are not actively running but it sounds like one of them has an override for SO_SalesJournal_upd that does a _bus object connection to a file/table that UDF Maint / Update needs exclusive access to, such as AR_Customer. They don't need to be actively running for the problem to occur.

    Doug was asking about apps that run from the "outside" like F9, Excel, and and Sage A&W / KnowledgeSync which all use ODBC or BOI and if BOI, not a problem if it uses a _svc object (as that means read-only). If BOI also not a problem if it does a _bus object connection (read/write) to a table/file that wouldn't be touched by UDF Maint / Update.



    ------------------------------
    Alnoor Cassim
    Accounting Systems, Inc. (ASI)
    ------------------------------



  • 16.  RE: Custom Office update "File in use"

    Posted 03-10-2025 04:45

    Thank you, Alnoor!



    ------------------------------
    Amber Prayfrock, Blytheco
    ------------------------------



  • 17.  RE: Custom Office update "File in use"

    Posted 03-10-2025 06:45

    @Alnoor Cassim  Why isn't this an issue with the base program as the "in use" error only happen when there is an override?  In Beth's example, if there wasn't an override and if she clicked update in UDF Maintenance why wouldn't that instantiate SO_SalesJournal_upd.pvc and AR_Customer_bus in the base programs and cause the same error? 



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 18.  RE: Custom Office update "File in use"

    Posted 03-10-2025 11:56

    @Doug Higgs that's an XLNT question. The answer is the Sage base classes for _UPDs never ever instantiate AR_Customer_bus or anything else (except for SO_Invoice_bus which are for the data entry tables). There are several _svc object connections done in the base class ON_CREATE. However, when it needs to write back to AR_Customer, or say to SO_SalesOrderHeader and SO_SalesOrderDetail for partial qty shipped backorder situations, or any of the history files and open invoice and trans pymt files that are touched, all of that is done directly with the ProvideX WRITE command. They don't use _bus objects at all during an Update (except SO_Invoice_bus). This is also the reason why scripts don't fire off during an Update.

    An argument could be made the MD should also directly WRITE to AR_Customer OR do the same instantiate to AR_Customer_bus but not in the ON_CREATE block (do it another point in the update). A 3rd option would be to do it in the ON_CREATE but only if coSession'StartProgram$<>"CM_UDFMAINT_UI"
    Which way is best practice? This is where we need official guidance from Sage engineers.



    ------------------------------
    Alnoor Cassim
    Accounting Systems, Inc. (ASI)
    ------------------------------



  • 19.  RE: Custom Office update "File in use"

    Posted 03-10-2025 13:02

    Terrific explanation @Alnoor Cassim  My guess is even with a ProvideX write there would be a temporary lock on the table however the chances of updating a UDF at the same time the table is being temporarily locked would be remote.



    ------------------------------
    Doug Higgs
    Midwest Commerce Solutions, Inc
    (312) 315-0960
    Chauffeur, Chef, and Personal Assistant to Sprinkles
    ------------------------------



  • 20.  RE: Custom Office update "File in use"

    Posted 03-10-2025 10:38

    Just to add one more gotcha to this thread as I recently had a similar battle. In my situation it was premium and even though I renamed Links, the file in use error still happened. I went so far as to rename the entire MAS90 folder and still got the message. It turned out that the client IT group had added the SQL databases to Microsoft Endpoint Detection and Response (EDR). Once they put in an exclusion for the SQL database we were able to add the field. One more thing to ask IT when we get stuck. 



    ------------------------------
    Kate Krueger
    Consultant
    MicroAccounting
    214.800.5555x553
    ------------------------------