Modify a form
Important
This content is archived and is not being updated. For the latest documentation, see Microsoft Dynamics 365 product documentation. For the latest release plans, see Dynamics 365 and Microsoft Power Platform release plans.
Applies To: Microsoft Dynamics AX 2012 R3, Microsoft Dynamics AX 2012 R2
Microsoft Dynamics AX for Retail POS introduces a new way to customize forms by using the Interaction service. This enables multiple developers to customize one or more forms in one service. If there are multiple customizations, the Interaction service loads only the first customization it finds for a form. The following list of forms use this new pattern and their implementations are included in the InteractionDefaults service.
ExtendedLogOnForm
ExtendedLogOnScanForm
frmBarcodeSelect
frmDimensions
frmInput
frmPayCash
frmPayCurrency
frmPayCustomerAccount
frmReturnTransaction
LogbookForm
LogOnForm
ManagerAccessForm
RegisterTimeForm
ViewTimeClockEntriesForm
ProductDetailsForm
ProductInformationForm
You customize a form by overriding the form and then changing its functionality and its look and feel. In the following example, you customize the LogOnForm form and change the background color.
In the folder where you installed the Retail POS SDK, open the Microsoft Dynamics AX for Retail POS Plug-ins folder. For more information on installing Retail POS Plug-ins, see Install the Retail SDK.
Open the Services folder and double-click the Services Visual Studio solution file.
Right-click the InteractionDefaults Visual Studio project name and rename the assembly.
Warning
When customizing Retail POS Plug-ins, it is recommended that you give the modified assemblies new names, so that the original assemblies remain available if you need to revert back to them.
In this step, you override the LogOnForm form, which has a dependency on the ManagerAccessForm. Remove the other forms from the InteractionDefaults project. This enables other users to override the excluded forms. override
To exclude unrelated forms from the project
Expand the WinFormsTouch folder and select all the forms except for the LogOnForm and ManagerAccessForm forms.
Right-click and select Exclude From Project.
The following diagram illustrates the Solution Explorer window:
Right-click the LoOnForm.cs file and select View Code.
Add the following code to the OnLoad() method for the first line of the method.
((Form)this.BackColor = Color.DarkRed;
Compile the InteractionDefaults project.
Copy your new assembly to the Pos\Services\InteractionDefaults\Extension folder and launch Retail POS. Your LogOnForm should now look like this: