This blog post comes from a question in the Microsoft Dynamics AX community board at https://community.dynamics.com/ax/f/33/t/120425.aspx. The question was how to map the full Product Name and not the NameAlias field that is in the InventTable table. The NameAlias field is a shorter field so it does not give you as good as description. I had originally suggested to use a custom function and provided a sample for it. This custom function would call a new AIF service in AX that would pull the product name.
I have outlined another approach below that I would recommend over the custom function strategy. I prefer this one as it retrieves the full product name the first time it retrieves data about the Item in AX.
Modify the AxdConnItem Query
In the AOT modify the AxdConnItem query by performing the following changes:
1. Add the EcoResProductTranslation table as a data source for the AxdConnItem query.
2. Only use the Name field since this is the only piece of data we are concerned about.
3. Add a Range where the LanguageId field is used. Pick the desired language for your own integration.
4. The Relation is shown in the below screen shot as InventTable.Product == EcoResProductTranslation.Product.
Data Source Properties:
Update the ConnItemSvcService Service
The CRM Connector calls the AIF ConnItemSvcService Service to detect modified Items from Dynamics AX. So this service will need to be updated for the changes we made to the AxdConnItem query it uses. This will be done using the AIF Document Service wizard.
1. In the AOT go to Tools – Application Integration Framework – Update document service.
2. Select the ConnItemSvcService Service class name and select the bottom two boxes and click OK:
3. Next refresh the AIF services by going to the Forms – AifService node in the AOT. Right click the AifService form to open the form and click Refresh. This process will take several minutes as any changes to the AIF services are detected and deployed.
4. Deactivate and Activate the DynamicsConnectorDefaultServices inbound port by going to the Forms – AifInboundPort node in the AOT. Right click the AifInboundPort form to open the form. Select the DynamicsConnectorDefaultServices inbound port to Deactivate and Activate it.
CRM Connector Changes
1. In the CRM Connector client, go into the AX 2012 Configuration Utility and configure the services. This process will recreate the Dynamics AX Object provider configuration files for the CRM Connector. This step will allow you to then map the Name field from the EcoResProductTranslation table.
2. In the Item Service to Product map, use the built-in GetPropertyFromInstance function for the Product Name field like below:
=GetPropertyFromInstance(EcoRes Product Translation, 0, “Name”)
The steps are now complete and when the map is activated, it should now start to integrate the full product name from Dynamics AX into Dynamics CRM.