Hello everybody; I've created a decimal field in a table and simply I want to copy the content of another decimal field from the same table. I've try newfield:=oldfiel; but doesn't works. I suppose it's easy but I'm starting with C/AL and I don't know too much.
Thanks.
0
Comments
In any case, if you are doing this operation thrue a report, don't forget the MODIFY instruction.
For instance:
Table1.Field2 := Table1.Field1;
Table1.MODIFY;
But oh my foes and oh my friends, it gives a lovely light
Thank you for help.
In the Table, in the field containing the data to be copied ("Field 1" in our example), your code must be in OnValidate :
"Field 2" := "Field 1";
Be carefull to the key:if "Field 2" is in the primary key you'll have to rename the record
But oh my foes and oh my friends, it gives a lovely light
Thanks.
1. Because you are on a form, so your value is not updated
2. Because the field is not editable
3. Because the destination field is in primary key
4.....
So:
Your code must be in the table and not in the form
If you modification is made in the form (when your code is really in the table) you must update your form to see the change.
Check if Field 2 is editable (in the table)
Check if it's not a flow field
Check if it's not a part of the primary key
But oh my foes and oh my friends, it gives a lovely light
Thanks.