A few thoughts:
1) If you do choose to stay with querying the related tables, SITEID ought to be included in those WHERE clauses.
2) As for when the values might not match -- if a user were to do a backend UPDATE or DELETE of data, this would throw it off. That is, if there were one LABTRANS record for that Work Order, and someone goes directly to the database and deletes that row, your WORKORDER.ACTLABCOST would have a value.
3) I'm assuming your intent would be to test to see if the Work Order's ACT fields are > 0.00. If Inventory, a Direct Issue purchase, or approved Labor Transaction are charged to the Work Order at zero cost, then querying the ACT fields would give you incorrect results but the EXISTS statements would do it right.
4) You may need to also consider whether or not the LABTRANS has been Approved or not. For example, if your Work Order has one LABTRANS entry that is not approved, then the ACTLABCOST should still be 0.00 until that LBATRANS record is approved.
------------------------------
Travis Herron
------------------------------
Original Message:
Sent: Sun August 22, 2021 01:23 AM
From: Shannon Rotz
Subject: WO actuals fields vs. trans tables
To my knowledge, it's quite rare for the ACTMATCOST, ACTSERVCOST, ACTLABCOST AND ACTTOOLCOST fields to be incorrect. The only case I can remember (in 20 years) was when there was a bit of a bug whereby when an item was returned, the ACTMATCOST value was not getting updated. I haven't checked lately to see if that was fixed.
Personally I would use the cost fields rather than trying to draw from the transaction tables for workflow - it will improve performance and the risk is low.
If you find that one of the cost fields is being updated incorrectly, you can always try to fix the cost field update problem rather than adjusting workflow.
------------------------------
Shannon Rotz
InComm Solutions
New Westminster BC
Original Message:
Sent: Sun August 22, 2021 12:56 AM
From: User1971
Subject: WO actuals fields vs. trans tables
MAM 7.6.1.2:
It's my understanding that there are two different ways to query for actuals:
1. The ACT fields in the WORKORDER table:
- actlabcost
- actmatcost
- actservcost
- acttoolcost,
2. The related transaction tables:
- labtrans
- matusetrans
- servrectrans
- tooltrans
Question:
Are there ever any scenarios where the values in ACT fields in WORKORDER aren't exactly the same as the values in the transaction tables?
The reason I ask is:
The team that set up my Maximo implementation had a habit of querying the transaction tables.
Example (from a node in the WO workflow):
exists (select 1 from matusetrans where refwo=:wonum) or exists (select 1 from labtrans where refwo =:wonum) or exists (select 1 from servrectrans where refwo=:wonum) or exists (select 1 from tooltrans where refwo =:wonum)
I don't understand why we would want to do that, since we have ACT fields right in the WORKORDER table. If I understand correctly, it would have been simpler/faster to query the ACT fields instead of the transaction tables.
With that said, I want to make sure that there isn't ever a reason to query the tables instead of the WO fields -- to get basic WO actual costs.
Thanks.
(Note: Neither approach includes task actuals.)
#AssetandFacilitiesManagement
#Maximo