I am in process to convert/upgrade an application to use CRM 2015 Online instead of CRM 2011. But it is failing to load relationship data with connection using CRM 2015. However it is working with CRM 2011. I have created the Entity wrapper using latest CRM 2015 SDK.
Code To Retrieve Order
var context = GetNewContext();
var ordersToProcess = (from o in context.SalesOrderSet
where o.SalesOrderId == orderId
select o).Distinct().ToList();
foreach (var salesOrder in ordersToProcess)
{
// *** Error Here ***
// *** CRM 2015 Code is throwing error here because transactioncurrency_salesorder is null ***
var urrencyCode =
salesOrder.transactioncurrency_salesorder.ISOCurrencyCode;
}
Generate Connection using CRM 2011 Code
public static CrmServiceContext GetNewContext(CrmConnection conn)
{
var context = new CrmServiceContext(conn);
return context;
}
Generate Connection using CRM 2015 Online Code
public static IOrganizationService GetNewService(CrmConnection conn)
{
var service = new OrganizationService(conn);
return service;
}
public static CrmServiceContext GetNewContext(CrmConnection conn)
{
var context = new CrmServiceContext(GetNewService(conn));
return context;
}
salesOrder
does have value buttransactioncurrency_salesorder
is null with 2015 online context. - user1211185