Search this insane blog:

Tuesday, December 29, 2009

Navision Report Triggers

So far, I have data triggers and report triggers:

ONPreDataItem()
This trigger is executed before a data item is processed,
but after the associated variable is initialized and table views and filters are set.
reference: http://msdn.microsoft.com/en-us/library/dd355150.aspx

OnAfterGetRecord()
Use this trigger to calculate variables that depend on the current record. In a form with a table box,
this trigger is called for each record in the table box, as the records are updated.

OnPostDataItem()
This trigger executes after the last record in the data item is processed but before the OnPostReport Trigger or the OnPostDataPort Trigger is executed, if it is the last data item of the report or dataport.
Use this trigger to perform any cleanup or post processing needed after a data item is processed. For example, if you create a non-printing report where records are updated, you can update all the records with the modification date like this.
source: http://msdn.microsoft.com/en-us/library/dd355360.aspx

Report Triggers:
OnInitReport()
Executes when the report is loaded.

OnPreReport()
This trigger executes after the request form is run.
The table views and filters for the report data items are set while this trigger is executed.
As this trigger is executed after the request form is processed,
you have access to any filters the user has set. If you want to print the settings of these filters in the report, you can retrieve them using the following text string.

OnPostReport()
This trigger is executed after all data items are processed.
The trigger is not run if the report was stopped manually or by using the QUIT function
before processing had concluded.

Because this trigger is executed after the report is processed,
you can use it to inform users about the result of the report run.
For example, if some records could not be processed, you could inform the
user of this using the following code in this trigger.


About Hyperlinks:
OnCreateHyperLink and OnHyperLink
Ever wondered about these triggers in navision and what they are meant for. Well Navision offers a facility to create links to the different objects within it. Using this feature a hyperlink could be created for a Form in Navision from the desktop. Creation of the hyperlinks is simple open the desired Form and then use the File -> Send to option to place a hyperlink on the desktop.

When the send to desktop option is used the first thing the option does is to call the OnCreateHyperlink trigger with the URL as the parameter. The URL parameter can be modified in the trigger giving one a control over what needs to be placed in the URL string. The OnHyperLink trigger is called when the form is accessed using this link and the URL is passed in the trigger.
(source: http://santoshkmrsingh.blogspot.com/2008/11/oncreatehyperlink-and-onhyperlink.html)
OnCreateHyperlink()
http://msdn.microsoft.com/en-us/library/dd301225.aspx


ONHyperlink()
http://msdn.microsoft.com/en-us/library/dd355085.aspx

Programming Microsoft Dynamics NAV

No comments:

Post a Comment