Different use of AL Find Functions for Filters in Dynamics 365 Business Central
This post provides tips about different find function in Business Central, including both long-standing C/AL strategies and newer concepts like partial records. FindSet vs FindFirst/FindLast FindSet and FindFirst/FindLast are two methods utilized in Dynamics 365 Business Central for extracting records from a table. The key distinction between them is that FindSet fetches a group of records, whereas FindFirst only fetches the initial record in the filter and FindLast fetches the last record. FindSet is employed when there’s a need to traverse through a sequence of records, and it’s advisable to use FindSet(true) if there’s a requirement to alter any record within the group. Conversely, FindFirst/FindLast is employed when only the initial or last record is needed and there’s no requirement for a loop. SetLoadFields The SetLoadFields function only loads the specified fields, thereby not fetching the remaining fields in the table and ensuring a quicker load. It is suitable for searchi...