Its Custom form. The combo box is not bound to the datasource. Because the actual datasource(DAWCustomerSeqMaster) has multiple repeated days as a normal string field. So I added combo box WeekDays enum to filter the related data from datasource. Now my target is I need to insert the selected combo box Week Day value in the custom table called DAWCustomerSeqMaster. Please see below screenshot I'm moving Select Customer To Assign from left to right Assign new customers to make the customer available on specific day for specific Rout in DAWCustomerSeqMaster table. The records CustAccount and RoutID is successfully created in DAWCustomerSeqMaster. But In DAWCustomerSeqMaster I have one more field called Day and I need to fill this field from WeekDays combo box selection once I move the customer from left to right.
Please have look my form full code.
[Form]
public class DAWCustSeq extends FormRun
{
SysListPanelRelationTableCallback listPanel;
container unassignedCustomer()
{
container assignedCustomer, data;
DirPartyTable dirPartyTable;
CustTable custTable;
DAWCustomerSeqMaster _seqMaster;
while select dirPartyTable join custTable where custTable.Party == dirPartyTable.RecId && dirPartyTable.RouteID == DAWRoutes_RouteID.valueStr()
notexists join _seqMaster
where _seqMaster.CustAccount == custTable.AccountNum
&& _seqMaster.Day == WeekDays.valueStr()
{
data = [custTable.AccountNum,
custTable.AccountNum,
custTable.name()
];
assignedCustomer +=[data];
}
return assignedCustomer;
}
container assignedCustomer()
{
container assignedCustomer, data;
DirPartyTable dirPartyTable;
CustTable custTable;
DAWCustomerSeqMaster _seqMaster;
while select dirPartyTable join custTable where custTable.Party == dirPartyTable.RecId && dirPartyTable.RouteID == DAWRoutes_RouteID.valueStr()
exists join _seqMaster
where _seqMaster.CustAccount == custTable.AccountNum
&& _seqMaster.Day == WeekDays.valueStr()
{
data = [custTable.AccountNum,
custTable.AccountNum,
custTable.name()
];
assignedCustomer +=[data];
}
return assignedCustomer;
}
public void init()
{
DAWCustomerSeqMaster _DAWCustomerSeqMaster;
container columns;
#ResAppl
columns = [0,0];
listPanel = SysListPanelRelationTableCallback::newForm(
element,
element.controlId(formControlStr(DAWCustSeq, Customers)), //1
"Assigned Customers",//2
"Select Customers To Assign", //3
#ImageCustomer,//4
tablenum(DAWCustomerSeqMaster),//5
fieldnum(DAWCustomerSeqMaster, CustAccount),//6
fieldnum(DAWCustomerSeqMaster, RouteID),
tablenum(DAWCustomerSeqMaster),//8
fieldnum(DAWCustomerSeqMaster, RouteID),//9
columns,
0, //11
'',//12
'',//13
identifierStr(assignedCustomer),//14
identifierStr(unassignedCustomer));//15
super();
listPanel.init();
}
public void refillListPane()
{
listPanel.parmRelationRangeValue(DAWCustomerSeqMaster.RouteID); //Route-A
listPanel.parmRelationRangeRecId(DAWCustomerSeqMaster.RecId);
listPanel.fill();
}
[DataSource]
class DAWCustomerSeqMaster
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public int active()
{
int ret;
ret = super();
if(DAWRoutes.RouteID)
{
info(DAWRoutes.RouteID);
element.refillListPane();
}
return ret;
}
/// <summary>
///
/// </summary>
public void executeQuery()
{
QueryBuildDataSource queryBuildDataSource;
queryBuildDataSource = this.query().dataSourceTable(tablenum(DAWCustomerSeqMaster));
queryBuildDataSource.clearRanges();
queryBuildDataSource.addRange(fieldnum(DAWCustomerSeqMaster, RouteID)).value(queryValue(WeekDays.valueStr()));
super();
}
}
[DataSource]
class DAWRoutes
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public int active()
{
int ret;
ret = super();
if(DAWRoutes.RouteID)
{
WeekDays.selection(WeekDays::None);
}
return ret;
}
}
[Control("ComboBox")]
class WeekDays
{
/// <summary>
///
/// </summary>
/// <returns></returns>
public int selectionChange()
{
int ret;
ret = super();
DAWCustomerSeqMaster_DS.executeQuery();
return ret;
}
}
[Control("TabPage")]
class Customers
{
/// <summary>
///
/// </summary>
public void pageActivated()
{
element.refillListPane();
super();
}
}
}