Hello,
I created a job to fix a data issue by getting the correct value from a view that had been modified but it's not doing the update. Please let me know if you can tell what I'm doing wrong.
Thank you
static
void
XTRA_Update_Asset_Departments(Args _args) { XTRAAssetMonthlyReport XTRAAssetMonthlyReport; XTRA_AssetDimensions XTRA_AssetDimensions;
whileselectforUpdate
XTRAAssetMonthlyReport
join
XTRA_AssetDimensions
where
XTRAAssetMonthlyReport.AssetId == XTRA_AssetDimensions.AssetId {
ttsBegin
;
if
(XTRAAssetMonthlyReport.DepartmentId != XTRA_AssetDimensions.DepartmentId) { info(
"AssetId "
+ XTRAAssetMonthlyReport.AssetId); XTRAAssetMonthlyReport.DepartmentId = XTRA_AssetDimensions.DepartmentId; } XTRAAssetMonthlyReport.update();
ttsCommit
;