NoteNote

The content in this topic only applies to Microsoft Dynamics NAV 2009 SP1. For Microsoft Dynamics NAV 2009 content, see Developer and IT Pro Help for Microsoft Dynamics NAV 2009.

After you have registered a RoleTailored client control add-in, you can use it on RoleTailored client pages. To use a control add-in on a page, you add it to a field control. Depending on the design of the control add-in, you may also need to do the following steps:

Preparing to Set Up the Control Add-in

To prepare for setting up the control add-in

  1. If the control add-in uses data from a table that does not exist, then create the table.

    For more information, see How to: Create a Table.

  2. If the page to which you want to add the control add-in does not exist, then create the page. As appropriate, associate the page with the table that you created in step 1.

    For more information, see How to: Create a Page.

Setting Up a Control Add-in on a Page Field

To set the ControlAddIn property on the field

  1. Open the Classic client.

  2. On the Tools menu, click Object Designer, and then click Page.

  3. Select the page, and then click Design.

  4. In Page Designer, add a field control for the control add-in or use an existing field control.

  5. Select the field, and then on the View menu, click Properties.

  6. In the ControlAddIn property value, click the lookup button.

  7. In the Client Add-in window, select the control add-in from the Client Add-in window, and then click OK.

    For more information, see the ControlAddin Property.

  8. To bind the field to data in a table field or C/AL global variable, set the SourceExpr property.

    NoteNote

    If the SourceExpr property is set to a C/AL global variable, then in the C/AL code, add code to the OnAfterGetRecord trigger to populate the global variable. For more information, see OnAfterGetRecord Trigger.

  9. Close the Properties window.

Modifying the RoleTailored Client Control Add-in Event Trigger

When invoked on a page, a control add-in can raise an event that sends data to Microsoft Dynamics NAV Server. In the C/AL code for the page, the event calls the OnControlAddIn trigger of the field control that is applied with the control add-in. To process the event data, you add C/AL code to the OnControlAddIn trigger. For more information, see Calling C/AL Triggers from a RoleTailored Client Control Add-in.

To add C/AL code to the control add-in event trigger

  1. On the View menu, click C/AL Code.

  2. In the C/AL Editor, locate the following field control trigger:

      CopyCode imageCopy Code
    Fieldname - OnControlAddIn(Index : Integer;Data : Text[1024])
    

    Fieldname is the name of the field control that is applied with the control add-in.

    NoteNote

    If the data type of the field's SourceExpr property is BigText, then the Data attribute is BigText instead of Text[1024].

  3. Add the C/AL code to the trigger.

  4. Close the C/AL Editor.

  5. On the File menu, click Save, select Compiled, and then click OK.

See Also