Hi Bruce,
Well, first of all, let me remind you that attacking directly the database with tSQL is not a very good idea. So, I always recomend doing it in TEST environment. Contact your RMS Partner.
Now, knowing your skills in tSQL and RMS database are good, I would say that your logic is OK, but not exact. For example, the field you are talking about, POType is not where the StoreID is saved, the correct field where this value is saved is logically StoreID field. The PO is "seen in HQ" not 'coz you changed the POType flag, but 'coz there was a change in that particular record in that particular table, which updated the DBTimeStamp field, which RMS compared to the DBTimeStame value for that record in RMS HQ Database in that particular table... Again, to be able to see the entries, you will have to "update" the PurchaseOrderEntry records, who are linked to the PO. Also, have in mind that there is additional table, PurchaseOrderEntryDetail where more information could be saved (not mandatory) per each entry in that particular PO....
So, to be able to help You to finish your task, I think the best would be if I share with you the possible values for some of the fields, so You can understand better the records:
1º) POType field in PurchaseOrder table
0 – Purchase Order
1 – Purchase Order generated from HQ
2 – Transfer In
3 – Transfer Out
4 – Transfer In created from HQ
5 - Transfer Out created from HQ
2º) Status field in PurchaseOrder table
0 – Open
1 – Partial
2 – Closed
3º) IsPlaced field in PurchaseOrder table
0 - Order has not yet placed
1 - Order has been placed
4º) ID field in PurchaseOrder table
- Auto generated; Primary key column
5º) PurchaseOrderID field in PurchaseORderEntry table
- Foreign key; Refers to ID column of PurchaseOrder table (this is how the entries are linked to the PO header, 1 to N relation)
6º) PurchaseOrderEntryID field in PurchaseOrderEntryDetail table
- Foreign key; Refers to ID column of PurchaseOrderEntry table (this is how the EntryDetails are linked to POEntries, 1 to 1 relation)
Hope this helps.
Two final tips, if I were You:
- I would go to the whole process with the user, to see how is he/she creating the POs, 'coz it's strange the RMS didn't upload the PO into HQ...check the system times of RMS HQ and RMS SO of that store in particular...
- if you have to go by tSQL, update a field that is "not important", like DateCreated or similar, that will automatically update the DBTimeStamp and with that upload the record on the next WS 401...
Kind regards, A.