Hi All,
I am doing some research on Adjust Cost Item Entries...where the C/ AL code iterates the Item Ledger Entry table and Updates the Item table based on the business logic...Well and Good...But when it comes to MODIFY statement it issues the following SQL Statement
UPDATE "BMW_INCADEA"."dbo"."BMW_REL_QA_EN_MAND2$Item" WITH (REPEATABLEREAD, ROWLOCK) SET "SA3 Default Option"=@P1 WHERE ("No_"=@P2)
There is no need for the above UPDATE with that Column....!
Do you folks encountered this scenario...?
Thanks,
Hed
Comments
RIS Plus, LLC
The Client Does modifies the Unit Cost and Profit But issues the wrong the Update Statement during the MODIFY Statement on the "UpdateUnitCost" procedure on the 5804 CodeUnit....
Any thoughts...???
Appreciated your early response...!
Hed.
So tell me... what should it have been then?
RIS Plus, LLC
The Issue is, Eventhough the Data are being modified by the Code Block...system is not sending appropriate Update Statements (with the Column Data changes)...or in an another scenario...it sends an update statement even if there is no change to that particular ROW...because you have MODIFY Statement without any check to see whether the data got modified or not...
I am just trying to see is there any possibility to avoid that unnecesary update statement...and thats where the I came to know about this invalid statement...
My ultimate goal is to optimize the Code, to run the system better...
Thanks for you update...
Hed.
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I finallly Found the Culprit...the catch is...
Even you literally update some columns in the record and if you're updating the same value on the column system is smart enought to not issue the update statement on the modified column as its already holding the same value. But it does pick the last column and issues the update anyway to complete that "MODIFY" code.
I will try to use MARK boolean to make sure whether or not we need to execute the code MODIFY if there is any real value change...
thanks folks,
Appreciated!
Hed.