I have this form:

which registration : for customer account
Group : for customer group
all : all cutomer:
then I add button in Cutomer : Sales and marketing>Customers>All customers

I want when I click on setup , I get records from the first form which:
the customeraccount = accountNum for the current cutomer
if the current cutomer have a chainId , search if this group exist in the first Form
get all the records which the field "Grouping-valid for" = All
so I add eventHandler onclick :
[FormControlEventHandler(formControlStr(CustTable, CodeBreakButton), FormControlEventType::Clicked)]
public static void CodeBreakButton_OnClicked(FormControl sender, FormControlEventArgs e)
{
Args args ;
Object formRun;
args = new Args();
args.record(sender.formRun().dataSource("CustTable").cursor());
args.name(formstr(CodeBreakTable));
formRun = classfactory.formRunClass(args);
formRun.init();
formRun.run();
formRun.wait();
}
the I add this code in init method in dataSource :
[DataSource]
class CodeBreakTable
{
public void init()
{
CustTable custTable;
QueryBuildRange qbr1;
QueryBuildDataSource queryBuildDataSource;
super();
if(element.args().record() == custTable)
{
Query query = new Query();
select CompanyChainId from custTable;
qbr1.value(strFmt('((%1.%2 == "%3" && (%1.%5 == %6)) && ((%1.%2 == "%4") && (%1.%5 == %7)) && (%1.%5 == %8))',
query.dataSourceTable(tableNum(CodeBreakTable)).name(), // CodeBreakTable %1
fieldStr(CodeBreakTable, CustomerAccount), // cutomerAccount %2
fieldStr(custTable, AccountNum),//%3
fieldStr(custTable, CompanyChainId),//%4
fieldStr(CodeBreakTable, CodeBreakPattern),//%5
any2int(CodeBreakPattern::Enregistrement), // %6
any2int(CodeBreakPattern::Groupe), // %7
any2int(CodeBreakPattern::Tout)));// %8
}
}
}
But when I run this code :
I get only the enum registration for the current customer :
