isDynamic and isRecalc are parameters used when working with record objects. Let’s understand the purpose of each parameter:
isDynamic: TheisDynamicparameter is used to indicate whether you want to work with a record object in dynamic mode. WhenisDynamicis set totrue, it allows you to access and manipulate any field or subrecord within the record, regardless of its visibility or mandatory status on the record form. This mode is particularly useful when you need to interact with fields dynamically, such as when building custom forms or automating data entry.Example :var customer = record.create({ type: record.Type.CUSTOMER, isDynamic: true });isRecalc: TheisRecalcparameter is used to control the recalculation behavior of a record. WhenisRecalcis set totrue, it triggers a recalculation of the record’s dependent fields and sublists. This can be helpful when you want to ensure that calculated fields or dependent fields are up-to-date based on their formulas or scripts.Example:var salesOrder = record.load({ type: record.Type.SALES_ORDER, id: '12345', isDynamic: true, isRecalc: true });In this example, when loading a Sales Order record in dynamic mode, settingisRecalctotrueensures that any dependent fields or sublists are recalculated based on their defined formulas or scripts.
Both isDynamic and isRecalc parameters are optional when working with record objects. By default, isDynamic is set to false (standard mode) and isRecalc is set to false (no recalculation). You can choose to set these parameters based on your specific requirements to work with records dynamically and trigger recalculation if needed.