MODIFY and MODIFYALL in D365 BC

MODIFY and MODIFYALL in D365 BC:

(1) Introduction: When records are modified in the tables via “AL” then MODIFY method is used. Note: recommended to modify any record in the table, specify filters on that record using “GET” or “SETRANGE” & “SETFILTER” for getting the records which you want to modify.

(2) Syntax: Modify.

[Ok :=] Record.Modify([RunTrigger])

(3) In the below example, Bill-to Address information is changed in the sales order, using MODIFY & MODIFY(TRUE) method as shown.

modify method in business central

(4) Introduction: If you modify a set of records in one go, then the MODIFYALL method is used.

(5) Syntax: MODIFYALL.

Record.ModifyAll(Field, NewValue [, RunTrigger])
MODIFYALL method in business central

(6) There is another way to modify a set of records in one go by using the “MODIFY” method with REPEAT UNTIL loop as shown.

modify method with repeat untill loop in dynamics 365

Use of SETRANGE and SETFILTER in Dynamics 365
Use of FINDFIRST FINDLAST and FINDSET in BC D365
Creation and Usage of FilterPageBuilder in BC D365
Page Extension Object– Microsoft Docs

Leave a Reply