Let's handle any exceptions within the Catch block:
- In the Catch block, we will handle system exceptions. So, let's choose Exception as System.Exception. Click on Add Activity in the Finally part and add a Log Message of Log Level set to Error with a message stating "Not able to Extract Customer list. Due to this Error: "+exception.Message.
- If there is an exception while we extract the customer list from CRM, then Automation won't be able to proceed. Let's add a Terminate Workflow activity to handle this. Within the properties for the Terminate activity, set Exception to exception (start typing and the list should pop up) and add "Cannot Extract Customer list from CRM, so terminating the Automation." as a reason, as shown in the following screenshot:
- Now, we have completed the first part of extracting the customer list from CRM. ...