Note |
---|
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:
-
Bind the control add-in field to a data source.
Control add-ins can use data from a field in the table that is associated with the page or from a C/AL global variable. For more information, see Binding a RoleTailored Client Control Add-in to the Database.
-
Modify the control add-in C/AL trigger to process data that is sent from the RoleTailored client. For more information, see Modifying the RoleTailored Client Control Add-in Event Trigger.
Preparing to Set Up the Control Add-in
To prepare for setting up the control add-in
-
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.
-
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
-
Open the Classic client.
-
On the Tools menu, click Object Designer, and then click Page.
-
Select the page, and then click Design.
-
In Page Designer, add a field control for the control add-in or use an existing field control.
-
Select the field, and then on the View menu, click Properties.
-
In the ControlAddIn property value, click the lookup button.
-
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.
-
To bind the field to data in a table field or C/AL global variable, set the SourceExpr property.
Note 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.
-
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
-
On the View menu, click C/AL Code.
-
In the C/AL Editor, locate the following field control trigger:
Copy Code Fieldname - OnControlAddIn(Index : Integer;Data : Text[1024])
Fieldname
is the name of the field control that is applied with the control add-in.Note If the data type of the field's SourceExpr property is BigText, then the
Data
attribute isBigText
instead ofText[1024]
. -
Add the C/AL code to the trigger.
-
Close the C/AL Editor.
-
On the File menu, click Save, select Compiled, and then click OK.
See Also
Tasks
How to: Install a RoleTailored Client Control Add-in AssemblyHow to: Register a RoleTailored Client Control Add-in
How to: Install a RoleTailored Client Control Add-in Assembly
Walkthrough: Creating and Using a RoleTailored Client Control Add-in
Reference
ControlAddin PropertyConcepts
RoleTailored Client Control Add-in OverviewInstalling and Configuring RoleTailored Client Control Add-ins on Pages
Developing RoleTailored Client Control Add-ins