Default Boolean to "Yes"

How do I default a Boolean / Check Box to be checked?

Set your boolean variable to TRUE: Variable := TRUE; Depending on where the variable is used you can also define this as a default value in properties.

This Boolean is on the request form of a report. I’m looking in the properties but I don’t see where I can default it to “True”.

use myvar := true; as speetz suggests in the oninitreport trigger there is no default value property for a variable

If this is going to be a default value all the time. Add it to the table property field. If you want to add it to the form. Go into the coding on the actual form (Not the button or subform). Section should be on Open then assign the value as the other messages “Field Name” := TRUE; If you want this on every new record, then you need to add the same coding to other sections: Oninsert() I believe. G.

There is absolutely no need to add a field to any table if all that you want is a checkbox on the request form that is set to true. The report designer is not very user friendly, and you have to know where to go to look at certain pieces of the code. Ok so you have a request form with a checkbox. The checkbox’s SourceExpr is a boolean variable. from the report designer, open the request form. Without selecting any control on the request form, press F9 or click the View menu and select C/AL Code. The window that opens from here is the C/AL editor for the request form. Put the assignment statement (MyBoolean := TRUE;) inside the OnOpenForm trigger, run your report and voila! HTH