On ProjBudgetImport form I have to set the default value of checkbox SummarizeByCategory control to No. Since there is no data source in the form so I extended the OnInitialized and also OnInitializing both event handlers to set the default value of a checkbox to "NO" but changes are not reflecting on the form. Similarly I extended the Init method of the form and use COC but still the value of checkbox is not changing, while keeping in mind the Value property of the checkbox is set to 1. Following were my code as shown below
[FormEventHandler(formStr(ProjBudgetImport), FormEventType::Initialized)]
public static void ProjBudgetImport_OnInitialized(xFormRun sender, FormEventArgs e)
{
FormCheckBoxControl CheckBox = sender.design().controlName(formControlStr(ProjBudgetImport,SummarizeByCategory)) as FormCheckBoxControl;
CheckBox.value(enum2int(NoYes::No));
}
Same above code I used for "OnInitializing" eventhandler it was giving error "Object reference not set to an instance."
For COC I used the following code
[ExtensionOf(Formstr(ProjBudgetImport))]
final class XYZ_ProjBudgetImportForm_Extension
{
public void init()
{
next init();
SummarizeByCategory.value(0);
}
}


Please let me know where I am lacking, Thanks.