FormListControl.getItem Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
getItem(Int32) |
Retrieves a FormListItem object for an item in a form list control. |
getItem(Int32, Int32) |
getItem(Int32)
Retrieves a FormListItem object for an item in a form list control.
public:
virtual Dynamics::AX::Application::FormListItem ^ getItem(int num1);
public virtual Dynamics.AX.Application.FormListItem getItem (int num1);
abstract member getItem : int -> Dynamics.AX.Application.FormListItem
override this.getItem : int -> Dynamics.AX.Application.FormListItem
Public Overridable Function getItem (num1 As Integer) As FormListItem
Parameters
- num1
- Int32
Returns
A FormListItem object for an item in a form list control.
Remarks
The following example shows a call to the getItem method to return a FormListItem object for each item in the form list control. The FormListItem.toString method returns a text string for each item. The while select statement retrieves account numbers from the CustTable table and then stores the data in a container. The items in the variable are added to the form list control by calling the FormListControl.addItem method.
static void createForm2(Args _args)
{
Args args;
Form form;
FormRun formRun;
FormBuildDesign formBuildDesign;
FormBuildDataSource formBuildDataSource;
FormBuildListControl formBuildListControl;
FormListControl formListControl;
FormListItem formListItem;
DictTable dictTable;
int idx4;
boolean columnadd;
str string;
str itemTxt;
container conAccountNum;
CustTable custTable;
int numAccounts;
int i;
int item;
// Create the form header.
form = new Form();
// Add data sources to the form.
dictTable = new DictTable(tableNum(custTable));
formBuildDataSource = form.addDataSource(dictTable.name());
formBuildDataSource.table(dictTable.id());
// Create the form design.
formBuildDesign = form.addDesign("Design");
formBuildDesign.caption("myForm");
// Add a form list control.
formBuildListControl =
formBuildDesign.addControl(FormControlType::ListView,"List");
idx4 = formBuildListControl.id();
args = new Args();
args.object(form);
// Create the run-time form.
formRun = classfactory.formRunClass(args);
formRun.run();
formRun.detach();
formListControl = formRun.control(idx4);
// Add an item to the form list control.
while select custTable
where custTable.AccountNum >=
"4000" && custTable.AccountNum <= "4040"
{
conAccountNum += [[custTable.AccountNum]];
}
numAccounts = conlen(conAccountNum);
for(i = 1; i <= numAccounts; i++)
{
string = conPeek(conAccountNum,i);
formListItem = new FormListItem(string);
item = formListControl.addItem(formListItem);
formListItem = formListControl.getItem(item);
itemTxt = formListItem.toString();
}
}
Applies to
getItem(Int32, Int32)
public:
virtual Dynamics::AX::Application::FormListItem ^ getItem(int _Idx, int _SubItem);
public virtual Dynamics.AX.Application.FormListItem getItem (int _Idx, int _SubItem);
abstract member getItem : int * int -> Dynamics.AX.Application.FormListItem
override this.getItem : int * int -> Dynamics.AX.Application.FormListItem
Public Overridable Function getItem (_Idx As Integer, _SubItem As Integer) As FormListItem
Parameters
- _Idx
- Int32
An Integer data type that specifies a sub-item in a form list control.
- _SubItem
- Int32
An Integer data type that specifies a sub-item in a form list control.