FormDataSourceMarks Class [AX 2012]

The FormDataSourceMarks class makes it easy to remember all marked rows in a given data source.

class FormDataSourceMarks implements SysFormDataSourceMarks

Run On

Client

  MethodDescription
Gg734112.pubmethod(en-us,AX.60).gif cancelTimeOut Cancels a previous method call to the setTimeOut method. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif equal Determines whether the specified object is equal to the current one. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif getMarksFromDataSource
Gg734112.pubmethod(en-us,AX.60).gif getTimeOutTimerHandle Returns the timer handle for the object. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif handle Retrieves the handle of the class of the object. (Inherited from Object.)
Gg734112.protmethod(en-us,AX.60).gif new Initializes a new instance of the FormDataSourceMarks class.
Gg734112.pubmethod(en-us,AX.60).gif notify Releases the hold on an object that has called the wait method on this object. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif notifyAll Releases a lock on the object that was issued by the wait method on this object. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif objectOnServer Determines whether the object is on a server. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif owner Returns the instance that owns the object. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif parmFormDataSource Gets or sets the FormDataSource parameter.
Gg734112.pubmethod(en-us,AX.60).gif setMarksOnDataSource
Gg734112.pubmethod(en-us,AX.60).gif setTimeOut Sets up the scheduled execution of a specified method. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif toString Returns a string that represents the current object. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif usageCount Returns the current number of references, that is, the value of the reference counter, that the object has. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif wait Pauses a process. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif xml Returns an XML string that represents the current object. (Inherited from Object.)
Gg734112.pubmethod(en-us,AX.60).gif Gg734112.static(en-us,AX.60).gif ::construct Initializes a new instance of the FormDataSourceMarks class.
Top

The current record should remain the same after the use of the class.

This class will not change the current settings of the data source. This class enables performing actions using the data source in between calling the getMarks and setMarks method calls.

This example demonstrates the use of the FormDataSourceMarks class. However, this example will not compile in a job as it must be run in the context of another class, a form, or other object.

public void run() 
{ 
    // Split transactions into the number of lines specified in "projQty". 
    FormDataSource      formDataSource;
    TmpProjAdjustment   localTmpProjAdjustment;
    FormDataSourceMarks formDataSourceMarks;
    formDataSource      tmpProjAdjustmentDS;
    ProjQty             projQty; 
    TmpProjAdjustment   tmpProjAdjustment; 
 
    try 
    { 
        if (!projQty && (tmpProjAdjustment.qty != 0 &&  
          (tmpProjAdjustment.adjustmentType != ProjAdjustmentType::Revenue))) 
        { 
            throw error(strFmt("@SYS56447", tmpProjAdjustment.qty)); 
        } 
        ttsbegin; 
        if (args && args.dataset() == tablenum(TmpProjAdjustment) &&  
          args.record().dataSource()) 
        { 
            formDataSource = args.record().dataSource(); 
            localTmpProjAdjustment.data(formDataSource.cursor()); 
            if (formDataSource.anyMarked()) 
            { 
                // Selection exists! 
                 // Remember marks. 
                formDataSourceMarks = FormDataSourceMarks::construct(); 
                formDataSourceMarks.parmFormDataSource(formDataSource); 
                formDataSourceMarks. getMarksFromDataSource(); 
                // Traverse the datasource - delete and split. 
                for (tmpProjAdjustment=formDataSource.anyMarked() ?  
                  formDataSource.getFirst(1) : args.record(); 
                     tmpProjAdjustment; 
                     tmpProjAdjustment=formDataSource.getNext()) 
                { 
                    // Find the entry given by tmpProjAdjustment, to be able  
                    // to update it. 
                    if ( formDataSource.findRecord(tmpProjAdjustment) ) 
                    { 
                        // Need this to be able to update tmpProjAdjustment. 
                        tmpProjAdjustment = formDataSource.cursor(); 
                        this.deleteTransaction(); 
                        this.splitTransaction(tmpProjAdjustment); 
                    } 
                } 
                tmpProjAdjustmentDS.executeQuery();     // No more marks. 
                // Mark up again. 
                formDataSourceMarks. getMarksFromDataSource(); 
            } 
            else 
            { 
                // No selection. 
                // Need this to be able to update tmpProjAdjustment. 
                tmpProjAdjustment = formDataSource.cursor(); 
                this.deleteTransaction(); 
                this.splitTransaction(tmpProjAdjustment); 
            } 
        } 
        ttscommit; 
    } 
    catch (Exception::Deadlock) 
    { 
        retry; 
    } 
    catch (Exception::Error) 
    { 
       throw error("@SYS18447"); 
    } 
}

Object Class
  FormDataSourceMarks Class

Community Additions

ADD
Show: