Hi All,
I'm creating a form part that has the same datasource as the main form. I was able to link the two forms and it works as expected. But I have another task that when an unbound combo box from the main form is set to no/yes, the records of the form part will be filtered as well. I have found this block of code in custtable that I think will work since this will refresh the records of the form part. But when I'm debugging this, it always says the datasource of the form part is null even though it is the same as the main form.
public static void refreshFormPart(FormRun _hostForm, str _formPartControlName, str _dataSourceTable)
{
FormPartReferenceControl formPartReferenceControl = _hostForm.getPartControlByName(_formPartControlName);
if (formPartReferenceControl && formPartReferenceControl.visible())
{
FormRun formRun = formPartReferenceControl.getPartFormRun();
if (formRun)
{
FormDataSource formDataSource = formRun.dataSource(_dataSourceTable);
if (formDataSource)
{
formDataSource.executeQuery();
}
}
}
}
Could you suggest what fix or other method should I use?
Thanks.