FormDataSource.leave Method [AX 2012]

Provides notification when the mouse pointer is moved to the next record or to another data source.

public boolean leave()

Run On

Client

Return Value

Type: boolean
Always returns true, unless the method is overridden.

This method is often overridden to implement record-level input validation.

The leave method can be overridden on a form data source by right-clicking the Methods node under the data source, pointing to Override Method, and then clicking leave.

The following example overrides the leave method to perform data validation before the current record is left. The method returns false if the data is invalid.

public boolean leave() 
{ 
    boolean ret; 
    ret = super(); 
    if(! salesLine.PBAItemLine::checkMandatory()) 
    { 
        return false; 
    } 
    return ret; 
}

Community Additions

ADD
Show: