Jaa


FormListControl.getNextItem Method

Definition

Overloads

getNextItem(FormListNext)

Retrieves the number of the next item in a form list control.

getNextItem(FormListNext, Int32)

getNextItem(FormListNext)

Retrieves the number of the next item in a form list control.

public:
 virtual int getNextItem(Dynamics::AX::Application::FormListNext next1);
public virtual int getNextItem (Dynamics.AX.Application.FormListNext next1);
abstract member getNextItem : Dynamics.AX.Application.FormListNext -> int
override this.getNextItem : Dynamics.AX.Application.FormListNext -> int
Public Overridable Function getNextItem (next1 As FormListNext) As Integer

Parameters

next1
FormListNext

Returns

An Integer data type value that indicates which item is the next item in a form list control.

Remarks

The following example shows a call to the getNextItem method to retrieve the number of the next item in the form list control. 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.

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; 
    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(77); 
    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 = new FormRun(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); 
        formListControl.addItem(formListItem); 
    } 
    item = formListControl.getNextItem(FormListNext::ToRight); 
}

Applies to

getNextItem(FormListNext, Int32)

public:
 virtual int getNextItem(Dynamics::AX::Application::FormListNext _nextType, int _startIdx);
public virtual int getNextItem (Dynamics.AX.Application.FormListNext _nextType, int _startIdx);
abstract member getNextItem : Dynamics.AX.Application.FormListNext * int -> int
override this.getNextItem : Dynamics.AX.Application.FormListNext * int -> int
Public Overridable Function getNextItem (_nextType As FormListNext, _startIdx As Integer) As Integer

Parameters

_nextType
FormListNext

An Integer data type that specifies the item that is before the next item.

_startIdx
Int32

An Integer data type that specifies the item that is before the next item.

Returns

Applies to