Thanks Jeremy for the response and sharing those articles. I looked at the
How To Rebuild Sage 100 Premium Tables article and wow if I was still at Sage I would have approached that differently. It doesn't address the normal root cause of that issue. I'm very pro-Premium / SQL (even sat as a panelist on the MotM SQL presentation too with
@Steve Iwanowski ,
@Robert White , and
@Jim Woodhead ) but my first approach always leans towards a solution that is platform agnostic that could work on Premium, Advanced, and Standard. It sounds to me like this could be the classic case of the dictionary not being in alignment with the physical table. If that is true, there is a command you can run for that (a 1-liner) and for Premium additional steps could be added.
How about this - Even if you don't use / need it, I'll post a sample of how to do this "rebuild" (with no T-SQL) and how to do the BOI / VBS version of this Error 47 fix (which also has no T-SQL and can deal with the Wrk and Restart tables), but in return I would ask you a favor of sorts. If you can accept my contact request, I'll explain it there.
------------------------------
Alnoor Cassim
Free Agent Developer and Consultant
CallForHelp.biz
Email:
alnoor@callforhelp.bizOrange County, CA
------------------------------
Original Message:
Sent: 03-14-2019 13:17
From: Jeremy Fox
Subject: Sage 100 Premium reinitialize Data Files
@Alnoor Cassim honestly I'd prefer the boi approach, but I'm just not sure how to actually pull it off for this conversation. KB76175 (and 69387 but i have that part worked out) the issue I'm having is with the Reinitialize of the IM_TransactionRegisterWrk and IM_transactionRestart. I honestly assumed reinitliazing files would be in the same vain of a rebuild sort/key files which previously was saying we couldn't really do directly by scripting. (i have pulled that off with autohotkey though).
now I expect that the next question is why it's needed regularly or why its needed in premium, the client is integrating with Pallet Track using VI scripts so I suspect that its somehow an issue with the "timing". though the short answer is roughly once every two months I need to "rebuild" the tables using the method Sage prescribes for premium and then reinitializeing those two and it works like a charm.
------------------------------
Jeremy Fox
Velosio LLC
------------------------------
Original Message:
Sent: 03-13-2019 01:19
From: Alnoor Cassim
Subject: Sage 100 Premium reinitialize Data Files
Jeremy - Can I ask which KB article resolution you are trying to automate? To answer your question in a word: YES. E.g. When Reinit'ing A/R Cash Receipts data entry tables, when you select AR_CashReceiptsDetail it will update AR_OpenInvoice to zero out the PaidToday column where PaidToday > 0 (which happens in the normal course of Cash Receipts Entry). Same thing with AP_OpenInvoice when you select AP_CheckDetail.
I'm not sure if you were trying to do this anyway with your VBS but it's better to use sy_reinitialize_bus with BOI to accomplish your task, as long as you know what you are doing and have tested and re-tested your solution. This way you don't have to worry about the Updates on ancillary tables and your code doesn't have to veer outside the object (no direct T-SQL required). I posted a response on how to do this a loooong time ago so maybe you'll find it with a search (try "sy_reinitialize_bus" )
About the WRK tables the base tables are empty. The ones with the Session ID appended to the table name have the data in them but in Premium those are created in TempDB like Kevin mentioned.
------------------------------
Alnoor Cassim
Free Agent Developer and Consultant
CallForHelp.biz
Email: alnoor@callforhelp.biz
Orange County, CA