This code shows how the use of SetLoadFields allows us to optimize calculations in Business Central, demonstrating that its use can execute our code up to more than 2.5 times faster for the conditions that were used.
For more information on its use visit the following link: https://ivansingleton.dev/using-partial-records-in-business-central-setloadfields/