SmartConnect error e-mail fails
We have a few maps runs on a schedule and if a document or the map fails e-mails should be sent out an e-mail to our Support inbox. We are eperiencing a few scenarios where the map does not generate an email or the email variables are blank. Has anyone experienced this or does anyone know what it could be? Below are the tasks that behaves oddly and details of the setup.
The strange scenarios we are experiencing are as follows:
1. When a map fails an email is sent out but all the global variables are blank
2. When a map fails no email is sent out but is shows in the Map Logs as unsuccessful
3. When one document fails, no email is sent out. No map error email is sent out
4. When more then one document fails, the last error email does not send
Document fail variables: GlobalMessage, GlobalLastError
Post map task variables: GlobalErrorCount, GlobalRunErrors
Actions taken so far:
1. Restarted SmartConnect and eConnect services
2. Re-Register Real-Time Triggers
3. Re-Register Maps
4. Checked test email can be sent
5. Rebooted the SmartConnect server and SQL server
6. Created a new map that will fail and generate e-mail and it replicated the error so it seems it is a global issue
7. Checked all logins and confimed they have the right permissions
8. Checked e-mail settings on the server and tested that SmartConnect can send e-mail from a map
9. Added and removed variables from the two tasks above
None of the actons above has eliminated the error and I don’t know what else to do. I have considered a SQL trace but since this does not happen frequent enough, it is not an option.
Data source: Dynamics CRM
Map destination: Dynamics GP
SC version: 220.127.116.11
SQL Server version: 2012
Thanks in advance
I inserted a copy of the task settings in the message body above but it did not make it….
Starting on SmartConnect 2017 you need to refer to the global variables in a script somewhere in the map in order for them to get complied. This was done to increase performance.
On SmartConnect 2016 and lower, it compiled all the varaibles regardless if they were being used in the map, which caused SmartConnect 2016 to be slower. SmartConnect 2017 actually runs maps about 5 times faster than SmartConnect 2016 because of the changes.
In order to get the values set, you need to create another task in the same location as the “Send Email” task. The new task will be of the “Run Script” Type.
Copy and paste the contents of the attached text file into the script window. Don’t change anything, copy it exactly like it is, and then hit validate. Then save the script.
The MOST important step is to use the up and down arrows to move the “Run Script” task ABOVE the “Send Email” task, so that it runs right before the email sends. That way the variables will get sent before the email is sent.
'-------- BEGIN SCRIPT -----------------
Dim My_String as string
'-------- END SCRIPT -----------------
This article needs to be updated then…
Marc, Thanks for the info. Do we need to choose unique variable names (My_String) per global variable or use the same as your sample script? Thanks!
I have updated the https://www.eonesolutions.com/tech-tuesday-smartconnect-email-task-feature/ article with the sample script to initialize variables for the email task.
We are using a GlobalVariable for the Email Address in the Map Success email task, and another one for passing a parameter to use in a stored procedure parameter.
Whenever we use the Document Fail Email Task, even using a hard coded email address, this makes the other global variables return blank, with the result no email is sent, and the stored procedure cannot run due to the blank parameter.
We found on one map, a message was returned the email address was not in the form of an email address for the Map Email task.
If you would like to submit an answer or comment, please sign in to the eOne portal.