Friday, July 13, 2018

Handles to the Objects in a Form

When programming in a form you can reference the individual objects, for
example the data sources or controls of the form, using the kernel classes used to
build them, or by overriding the methods on the object itself.
All methods in the form are related to an object. The object can be accessed from
the methods associated with it, by using the handle
this. Note that this reference
is relative to where you are programming.
When referencing an object from a method that is not associated with that object,
you need to use the object handle. The following table lists the objects and how
to access them:

Object Access from X++
FormRun Element
FormDataSource <name of data source>_DS
Active record in data
source
<name of data source>
FormDataObject FormDataSource.Object(<fieldId>)
FormDesign FormRun.design()
Form……Control Name assigned to control, when property
AutoDeclaration is set to Yes.
or
element.control(Control::<name of control>)


Query <name of data source>_Q
or
FormDataSource.Query()
QueryRun <name of data source>_QR
or
FormDataSource.QueryRun()

The method control() on the element object can be used if the control is included
in an auto field group. In this situation you cannot use the auto declaration
feature.
 


Best Regards,
Hossein Karimi

No comments:

Post a Comment

Configure the Firewall on the Enterprise Portal Server

After you install Enterprise Portal, enable Web Server (HTTP) in Windows Firewall. If you do not enable the web server in Windows Firewall...