亿博电竞赛事信息
Do you need a lookup that allows you to select multiple items in Microsoft 亿博电竞 AX? Do you need to store the multiple values in the database? Check out the following example using multi select lookup that allows you to select multiple main accounts in AX.
Use the following steps to create Multi Select Lookup in 亿博电竞 AX:
1. Create an AOT query for the lookup.
2. Create the control on the form, set the auto declaration property to yes
3. In the Modified method of the control:
public boolean
modified()
{
boolean ret;
ret = super ();
ttsBegin
;
SalesParameters.SSI_MainAccountId = SSI_MultisitePostingSales_Invoice_SSI_MainAccountId.text();
SalesParameters.update();
ttsCommit
;
return
ret;
}
4. In the Class Declaration of the form:
SysLookupMultiSelectCtrl msCtrl;
5. In the Init method of the form:
msCtrl = SysLookupMultiSelectCtrl::construct(element, SSI_MultisitePostingSales_Invoice_SSI_MainAccountId,
queryStr (SSI_MainAccount));
6. On the form datasource Execute query method:
public void
executeQuery()
{
super
();
this.SSI_updateMainAccountCtrl();
}
7. On the form datasource create a new method to update the ctrl on load of the form:
public void
SSI_updateMainAccountCtrl()
{
container
mainAccounts;
//Set the control value
SSI_MultisitePostingSales_Invoice_SSI_MainAccountId.text(SalesParameters.SSI_MainAccountId);
//Mark the appropriate checkbox in the drop down
mainAccounts = conNull();
mainAccounts = this.SSI_createContainers();
if (mainAccounts !=
conNull
())
{
// Set controls for existing records
msCtrl.set(mainAccounts);
}
else
{
msCtrl.set(
conNull
());
}
}
8. On the form datasource create a new method to hold the values that should be checked on the load of the form:
public container
SSI_createContainers()
{
List list =
new
List(Types::String);
ListIterator i;
container
RecIds, Names;
RecId id;
//Create Container for the RecIds, Names
list = Global::strSplit(SalesParameters.SSI_MainAccountId,”;”);
i =
new
ListIterator(list);
while
(i.more())
{
id = MainAccount::findByMainAccountId(i.value()).RecId;
RecIds += id;
Names += i.value();
i.next();
}
return ;
}