Hi everyone,
Recently we got our CRM online migrated to Dynamics 365. I have my CRM system integration with another third party system, To retrieve list of accounts with multiple column values, i was using CRM SDK via C# program. However after we migrated to Dynamics 365, my code is no longer working. Below is the code snipped which used to retrieve accounts list;
public static List<Account> GetCRMAccounts()
{
try
{
List<Account> p = new List<Account>();
var appConfig = ConfigurationManager.OpenExeConfiguration(Assembly.GetExecutingAssembly().Location);
string connectionString = appConfig.AppSettings.Settings["CRM"].Value.ToString().Trim();
CrmServiceClient crmConn = new CrmServiceClient(connectionString);
IOrganizationService crmService = crmConn.OrganizationServiceProxy;
QueryExpression qe = new QueryExpression
{
EntityName = "account",
ColumnSet = new ColumnSet("accountid", "name", "new_nickname")
};
EntityCollection accounts = crmService.RetrieveMultiple(qe);
-------------------------------------------------------------------------------------------------------------------------
However the above code throw "Object reference not set to instance error" at the last line "EntityCollection accounts = crmService.RetrieveMultiple(qe);"
Not sure what has been changed upon migration.
Please can somebody help me to solve the issue?
Again i'm on Dynamics 365.