Communication via object calls

Sometimes, we need to create an object, which in turn calls other objects. We may simply want to allow the user to be able to run a series of processes and reports, but only enter the controlling parameters once. Our user-interface object will be responsible for invoking the subordinate objects after having communicated setup and filter parameters.

There is an important set of standard functions designed for various modes and circumstances of invoking other objects. Examples of these functions are SETTABLEVIEW, SETRECORD, and GETRECORD (there are others as well). There are also instances where we will need to build our own data passing function.

In order to properly manage these relatively complex processes, we need to be familiar with the various versions of RUN and RUNMODAL functions. We will also need to understand the meaning and effect of a single instance or multiple instances of an object. Briefly, key differences between invoking a page or report object from within another object through RUN versus RUNMODAL are as follows:

  • RUN will Clear the instance of the invoked object every time the object completes, which means that all of the internal variables are initialized. This clearing behavior does not apply to a codeunit object; state will be maintained across multiple calls to RUN.
  • RUNMODAL does not clear the instance of the invoked object, so internal global variables are not reinitialized each time the object is called. The object can be reinitialized using CLEAR(Object).
  • RUNMODAL does not allow any other object to be active in the same user session while it is running; whereas RUN allows another object instance to run in parallel with the object instance initiated by RUN.

Covering these topics in more detail is too advanced for this book, but once you have mastered the material covered here, you should study the information in the Developer and IT Pro Help section relative to this topic. There is also Pattern documentation on this topic defined at https://community.dynamics.com/nav/w/designpatterns/108.posting-routine-select-behaviour.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset