CALCFIELDS and SETAUTOCALCFIELDS function in D365 BC:
In this blog, we will know about the difference between CALCFIELDS and SETAUTOCALCFIELDS function in D365 BC.
CALCFIELDS | SETAUTOCALCFIELDS |
---|---|
Syntax: [Ok :=] Record.CALCFIELDS(Field1, [Field2],…) | Syntax: [OK :=] Record.SETAUTOCALCFIELDS([Field1,Field2, …]) |
Calculates the FlowFields in a record. You specify which fields to calculate by using parameters. | Sets the FlowFields that you specify to be automatically calculated when the record is retrieved from the database. |
The FlowFields or BLOB fields that you want to calculate or retrieve. Each field must belong to the same record variable. | The FlowFields that you want to automatically calculate. Each field must be defined as a FlowField and must belong to the same record variable. |
This feature is not available. | To remove the automatic calculation setting on a field, you must call SETAUTOCALCFIELDS without parameters. |
CALCFIELDS retrieves a record using the FIND Function (Record) and NEXT Function (Record). | Call SETAUTOCALCFIELDS before you retrieve the records, then when you call FIND and NEXT. |
CALCFIELDS function to retrieve binary large objects (BLOBs). | This feature is not available. |
Use system memory more while executing. | Use system memory less while executing. So the performance of the system enhance. |
This function is available in NAV 2009,..BC D365. | This function is introduced in NAV 2013 version and so on. |
CALCFIELDS creates a separate query for calculating values of flowfields. | SETAUTOCALCFIELDS creates one query with auto joining with filters to get value from flowfields. |
Image A: Refer for more info. | Image B: Refer for more info. |
Image A |
Image B |