Administrative access mode

When you have edited your Sitemap so every subarea is with the Privilege read and then you want to have a user that is with administrative access mode, the user won’t be able to access the Dynamics CRM, even seeing the menu.

When the user browses CRM, the application will try to display the default user area.

If you remove the option: <Privilege Entity=”new_test” Privilege=”Read” /> the user with administrative access mode will be able to view the CRM.

The other option is to have the permission to Read-Write.

Hope this helps

Advertisements

Plugin Registered in the RetrieveMultiple for all entities

When you are trying to install a solution from the Office 365 Admin Center, but you get a generic error and it is saying to try again later, this might be related to an issue with a Retrieve Multiple plugin that is registered for all entities.

You go to Office 365, then you go to Admin. After that in the left menu you expand Admin and click in Dynamics 365, it will open the Instance Picker page with all the instances that you have.

After that you select the instance and press the Solution option, it should open a new page where you can install/update/uninstall solutions to that CRM instance. If it isn’t opening and you are getting an error it might be the problem that I described before.

You need to open the solution and go to the SDK messages and check the message column and filter by the message RetrieveMultiple, or if you know the assembly, open the PluginRegistrationTool and disable the plugin and try to open the solutions page again in the Instance Picker page.

Hope this helps.

Workflow Process Corruption

When you have a workflow that is calling in a step a Custom Workflow Activity and you putting a workflow in draft, the Condition Expressions show as “Invalid Condition expression”. When you try to re-activate the workflow it isn’t possible because of the conditions.

This issue might appear if you changed the internal name of the input/output parameter and published the plugin. It will make the condition invalid because, the parameter that was used in the create/update step that is inside the condition is invalid, it is not recognizing the parameter. You need to remove the step and add it again.

Doing the deletion of the step and was able to change the condition branch and redo the Invalid condition expressions and after that, it was able to publish the workflow. Then added the step again. That way it was using the correct output parameter schema name.

Hope this helps.

Setting “File size limit for attachments” stops solution import

There is a situation that some users might face when the option in the System Settings “Set file size limit” is changed, and they aren’t able to import a solution is receiving a message that “Webresource content size is too big”.

When you change this option, for example to 500, the files like webresources are influenced by this value so it wouldn’t create a webresource with a size higher than 500kb. It will also influence the import of a solution since the internal process will check the size of the web resource.

The maximum size of files that can be uploaded is determined by the Organization.MaxUploadFileSize property. This property is set in the E-mail tab of the System Settings in the application. This setting limits the size of files that can be attached to e-mail messages, notes, and and unfortunately web resources. The default setting is 5MB.

Hope this helps.

 

Import managed solution with BPF prefix new_

There are some issues when you upgrade the Dev environment and you have custom Business Process Flows (BPF) and when you export the solution with that BPF as manage and import in the Test/Prod environment but it is giving an error. This is because the prefix of the BPF is with “new_” instead of the prefix of the solution.

 
There is a known article that explains how to solve the issue:

https://support.microsoft.com/en-us/help/4020021/after-updating-to-dynamics-365-mismatched-business-process-flow-entity

Following the steps will help you to overcome this issue without having to open a support ticket or running scripts directly in the DB.

Have in mind that these steps are to be performed in the sandbox that there isn’t any problem deleting the BPF so the records related to that are all deleted.

Hope this helps.

Settings submenu not showing

Sometimes I’ve seen some problems when the instance of Dynamics updated to the Dynamics 365 and the Settings group doesn’t show all the options available, at least I’ve seen when was an update.

If this happens you can check if the option Show Group in the Settings area is checked. You can do this by using the XrmToolBox application, with the SiteMap Editor plug-in, or you can download a solution that contains the Sitemap and check if that property is in the Settings area.

Then you just need to upload your Sitemap and the groups will show up again.

Hope this helps.

Alternate Key (Keys) failed to reactivate

There have been some issues when you try to activate an Alternate key but it stays in the state of failed, this might be because the internal process has created the index for the key but it didn’t stay as active in the UI and in the table that saves that information.

If you are OnPrem, what you will need to do is to go to the table of that entity and then on the index folder delete the index that was created. Then you go to CRM and just need to re-activate the alternate key.

If you are Online you will need to submit a Service Request, saying that the Alternate Key isn’t being activated and you want that the support engineer have a look into it.

Hope this helps

Simple connection example with the new Microsoft.Xrm.Tooling.Connector

So there is a new DLL that allows us to connect to CRM from 8.2 version forward (Dynamics 365).
To use this in the code you can use the EarlyBounds that you can generate using the SDK and then add it to your project. Afterwards you just need to insert the code and and references missing to your project:

using Microsoft.Xrm.Sdk;
using Microsoft.Xrm.Sdk.Query;
using Microsoft.Xrm.Tooling.Connector;

namespace ConsoleApplication1
{
public static class Program
{
private static IOrganizationService _serviceProxy;

static void Main(string[] args)
{
try
{
string connectionString = GetServiceConfiguration();

CrmServiceClient conn = new CrmServiceClient(connectionString);
_serviceProxy = (IOrganizationService)conn.OrganizationWebProxyClient != null ? (IOrganizationService)conn.OrganizationWebProxyClient : (IOrganizationService)conn.OrganizationServiceProxy;

string fetchXml = @”<fetch version=’1.0′ output-format=’xml-platform’ mapping=’logical’ distinct=’false’>
<entity name=’systemuser’>
<all-attributes />
<order attribute=’systemuserid’ descending=’false’ />
</entity>
</fetch>”;

EntityCollection result = _serviceProxy.RetrieveMultiple(new FetchExpression(fetchXml));

}
catch (Exception ex)
{

throw;
}
}

private static String GetServiceConfiguration()
{
// Get available connection strings from app.config.
int count = ConfigurationManager.ConnectionStrings.Count;

// Create a filter list of connection strings so that we have a list of valid
// connection strings for Microsoft Dynamics CRM only.
List<KeyValuePair<String, String>> filteredConnectionStrings =
new List<KeyValuePair<String, String>>();

for (int a = 0; a < count; a++)
{
if (isValidConnectionString(ConfigurationManager.ConnectionStrings[a].ConnectionString))
filteredConnectionStrings.Add
(new KeyValuePair<string, string>
(ConfigurationManager.ConnectionStrings[a].Name,
ConfigurationManager.ConnectionStrings[a].ConnectionString));
}

// No valid connections strings found. Write out and error message.
if (filteredConnectionStrings.Count == 0)
{
Console.WriteLine(“An app.config file containing at least one valid Microsoft Dynamics CRM ” +
“connection string configuration must exist in the run-time folder.”);
Console.WriteLine(“\nThere are several commented out example connection strings in ” +
“the provided app.config file. Uncomment one of them and modify the string according ” +
“to your Microsoft Dynamics CRM installation. Then re-run the sample.”);
return null;
}

// If one valid connection string is found, use that.
if (filteredConnectionStrings.Count == 1)
{
return filteredConnectionStrings[0].Value;
}

// If more than one valid connection string is found, let the user decide which to use.
if (filteredConnectionStrings.Count > 1)
{
Console.WriteLine(“The following connections are available:”);
Console.WriteLine(“————————————————“);

for (int i = 0; i < filteredConnectionStrings.Count; i++)
{
Console.Write(“\n({0}) {1}\t”,
i + 1, filteredConnectionStrings[i].Key);
}

Console.WriteLine();

Console.Write(“\nType the number of the connection to use (1-{0}) [{0}] : “,
filteredConnectionStrings.Count);
String input = Console.ReadLine();
int configNumber;
if (input == String.Empty) input = filteredConnectionStrings.Count.ToString();
if (!Int32.TryParse(input, out configNumber) || configNumber > count ||
configNumber == 0)
{
Console.WriteLine(“Option not valid.”);
return null;
}

return filteredConnectionStrings[configNumber – 1].Value;

}
return null;

}

private static Boolean isValidConnectionString(String connectionString)
{
// At a minimum, a connection string must contain one of these arguments.
if (connectionString.Contains(“Url=”) ||
connectionString.Contains(“Server=”) ||
connectionString.Contains(“ServiceUri=”))
return true;

return false;
}

app.config:

<configuration>
<connectionStrings>
<!– Online using Office 365 –>
<add name=”Server=CRM Online, organization=contoso, user=someone”
connectionString=”Url=https://<ORG>.crm4.dynamics.com; Username=<USERNAME>@<ORG>.onmicrosoft.com; Password=<PASSWORD>; authtype=Office365″/>

<!– On-premises with provided user credentials –>
<!– <add name=”Server=myserver, organization=AdventureWorksCycle, user=administrator”
connectionString=”Url=http://myserver/AdventureWorksCycle; Domain=mydomain; Username=administrator; Password=password; authtype=AD”/> –>

<!– On-premises using Windows integrated security –>
<!– <add name=”Server=myserver, organization=AdventureWorksCycle”
connectionString=”Url=http://myserver/AdventureWorksCycle; authtype=AD”/> –>

<!– On-Premises (IFD) with claims –>
<!–<add name=”Server=litware.com, organization=contoso, user=someone@litware.com”
connectionString=”Url=https://contoso.litware.com/contoso; Username=someone@litware.com; Password=password; authtype=IFD”/>–>
</connectionStrings>
<startup>
<supportedRuntime version=”v4.0″ sku=”.NETFramework,Version=v4.5.2″ />
</startup>

CRM Audit info dissapeared

Some of the New Value data might disappear (have the broken icon instead of the value) when you import a solution that disables the Audit of the entity or if the Audit is already disabled and then you enable Audit.
It is a known issue and if you are working on online you will need to create a Service Request to the Support.
If you are OnPrem you will need to run the following SQL script to check and then clean the records:

Select * from AuditBase WHERE action = 104 OR action = 102
Action = 104 | Any Auditing Changes that are made at Organization level would get captured with code 104.

Action = 102 | Any Auditing Changes that are made at Entity level would get captured with code 102.

In order to retrieve the Audit value from the DB, we would need to run the following command:

DELETE from AuditBase WHERE action = 104 AND CreatedOn > ‘<date>’ || Action = 104 or 102, depending on the results we get the above SELECT query

After this, the values will show again.

Invalid User Authorization

When you get an error like this, when you try to open a Workflow that is in Draft mode, check first if you are using Custom Workflow Activities in that workflow and if the Custom Workflow is update with the most recent dll’s for the version of your Dynamics CRM instance.

I had a issue like that and updating the dll’s solved the problem.