Home

Thursday, September 25, 2014

Select multiple records from lookups in Dynamics AX 2012

Retrieve multiple selected records from Grid using X++. in AX dynamics 2012

Retrieve all selected records of a datasource in a Grid


    int             recordsCount;
    Student     studentLocal;
    super();
    
    recordsCount = student_ds.recordsMarked().lastIndex();  // Total no of marked records.
    studentLocal = student_ds.getFirst(1);
    
    while (studentLocal)
    {
        info(studentLocal.Name +" " +studentLocal.ID);
        studentLocal = student_ds.getNext();
    }

How to set null value in reference control on a Form

ABCTable _ds.object(fieldNum(ABCTable, Field1)).setValue(0);
ABC_ds.rereadReferenceDataSources();
Or
ABCTable _ds.object.Field1 = 0;
ABC_ds.rereadReferenceDataSources();