Hi,
I wrote a function to extend the Connector that relates an account with a contact.
The standard one was not workn
[MappingFunctionCategory(Category = "Custom"), MappingFunction(Description = "Return the string before the comma")] public static string ExtractNameBeforeComma(string containingString = "defaultString") { string result = ""; string integrationKey = containingString; if (integrationKey.Contains(',')) { int index = integrationKey.IndexOf(','); result = integrationKey.Substring(0, index); } return result; }
As you can see the code is very simple. Connector creates a value on the Contact\DynamicsIntegrationKey equals to RecID,DynamicsIntegrationKey like this one 53286,bf021a27-8eab-e311-bfb0-0050569239ef
What I need to do is to extract the first number (the recordid) to associate it with the account.
It works fine if the account has a primary contact, but it doesn't work when it does not have it.
The error I can find on the log is: Value cannot be null. Parameter name: source on Connector
Is there any way to avoid this error?