about element

display date dtToDate()

{

// return toDate;

return element.ToDate();

}

please tell me that what is element here and what is doing here.

element variable usually refers to the current form or report instance - the exact answer depends on where dtToDate() is defined. The code simply calls ToDate() method defined in the form/report.

In forms the collection of objects is contained within a FormRun object. You can reference members in the outer FormRun object by using the “element” reference.

http://stackoverflow.com/questions/4260403/this-vs-element-keyword-in-x