what exactly an assignment of a record variable to record variable means
for example in "Bank Account Ledger Entry"OnAfterGetRecord trigger i find the following code:
BankAccLedgEntry2 := "Bank Account Ledger Entry";
WITH BankAccLedgEntry2 DO BEGIN
...
END;
is BankAccLedgEntry2 another table-cursor to the same undelying table with fields, filters assigned from original one or does it become another reference to the same table-cursor ?
C/SIDE courseware explains the situation with codeunit variables but is very vague on this issue with Record variables.
Thank you for your help
0
Comments
will not copy the filters ( just the field values), you need to use the COPY function for this, or a separate COPYFILTERS after the assignment.
You can step through BankAccLedgEntry2 independently, performing any action needed, while leaving the cursor on "Bank Account Ledger Entry" untouched, so it should be a different table-cursor.
BankAccLedgEntry2.transferfields("Bank Account Ledger Entry");
It doesn't copy filters, when you do assignment. It basically creates another recordset pointing to the same record. It is a different version so if you modify with BankAccLedgEntry2.
and then modify "Bank Account Ledger Entry", you'll get another user modifeid error.
To copy all the filters use
BankAccLedgEntry2.copy("Bank Account Ledger Entry");
Copy will have the filters. but still is a different version.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n