Microsoft Dynamics NAV Documentation
How To: Setup User Event
A User Event is similar to a code event and is used to trigger a pipeline based on a user action, such as clicking a button on a page.
To setup user event:
- Create an export connection and insert the element USEREVENT.
- On the elements line, click Edit.
- On the User Event Setup, fill in the following fields:
Field |
Description |
Page No. |
Specify the page number. The user actions is added to this page. |
Page Name |
The page name is specified automatically. |
Table No. |
Specify the table filter. This filter will be applied on the data set. |
Table Filter |
Specify the table filter. This filter will be applied on the data set. |
Post with Job Queue |
Select this field if you want to process the connection using the job queue with a specific category. |
Job Queue Category Code |
Select the job queue category used for grouping and filtering jobs. |
- Click Check Configuration to see if there are any configuration errors.
- Click Ok.
To add a user event to a page:
- Open the page to which you want to add the action button in the NAV Object Designer. A user event always requires an action button to start the event.
- Add a new action to the page activities.
- Create the following local variables:
Name |
DataType |
Subtype |
RegisterPipelineEvent |
Codeunit |
N108 Register Pipeline Event |
RecRef |
RecordRef |
|
- Add C/Side statements to this trigger:
Recref.GETTABLE(Rec);
RegisterPipelineEvent.RegisterEventForRecord(RecRef);