One approach for this that I tested successfully is to create a custom function using the CRM Connector SDK guidance. The SDK is available at mbs.microsoft.com/.../mdax_dynamicsconnector.
The custom function calls a custom AX AIF service that is created from a query between InventTable and EcoResProductTranslation. In the mapping window for the Product Name field, you will use the custom function to get beloved full product name!
High level steps:
1. Create a new AX AIF service based on a query that has InventTable as parent table and EcoResProductTranslation as child. Join on Parent field.
2. After registering the service, create a new inbound Net.Tcp port in AX for this service. Only need to add the read service operation.
3. Create custom function (C# library) using something like this:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Dynamics.Integration.Mapping; //assembly required for mapping functions in CRM Conn
using ItemNameFunction.IVName; //service reference
using System.ServiceModel.Channels; //Binding
using System.ServiceModel; //endpoint
namespace ItemNameFunction
{
[MappingHelper]
public class IVItemFunction : LocalizedMappingHelper
{
[MappingFunction(Description = "Returns the Product Full Name for the Product ID.")]
[MappingFunctionCategory(Category = "AX Item to CRM Product")]
public static string ReturnProdFullName(string ProdId, string Company, string URL, string Username, string Domain, string Password)
{
NetTcpBinding binding = new NetTcpBinding();
binding.MaxReceivedMessageSize = 2147483647;
binding.MaxBufferPoolSize = 2147483647;
EndpointAddress remoteAddress = new EndpointAddress(new Uri(URL), EndpointIdentity.CreateSpnIdentity(string.Empty));
InventTableCnServiceClient client = new InventTableCnServiceClient(binding, remoteAddress);
client.ClientCredentials.Windows.ClientCredential = new System.Net.NetworkCredential(Username, Password, Domain);
CallContext cc = new CallContext();
cc.Company = Company;
QueryCriteria qc = new QueryCriteria();
qc.CriteriaElement = new CriteriaElement[1];
qc.CriteriaElement[0] = new CriteriaElement();
qc.CriteriaElement[0].FieldName = "ItemId";
qc.CriteriaElement[0].DataSourceName = "InventTable";
qc.CriteriaElement[0].Value1 = ProdId;
EntityKey[] keylist = client.findKeys(cc, qc);
AxdInventTableCn item = client.read(cc, keylist);
string accountName = item.InventTable[0].EcoResProductTranslation[0].Name;
return accountName;
}
}
}
4. Place the new dll file into C:\Program Files (x86)\Microsoft Dynamics\Microsoft Dynamics Adapter\MappingHelpers folder. Close CRM Connector client, restart the Connector service, and open CRM Connector client.
5. In the Item Service to Product map, edit the Product Name field so it maps to the new function. In this example, there are several parameters to map to. Mine looks like:
=ReturnProdFullName(Item Id, "CEU", "net.tcp://DAX2012:8201/DynamicsAx/Services/InventTableCnServicePort", "administrator", "contoso", "pass@word1")