CurrentRow is not accessible in Catch block in Try Catch. Getting an error when writing an email and in that i am using CurrentRow(0).ToString. Please let me what is the issue. See screenshot.
Hello @Puneet_Singh,
Assign the variable and set the scope of the variable to the highest level. This will then allow you to use the information in the catch block.
Best,
Cam
That’s wrong. CurrentRow is a variable created within the For Each, created by the For Each.
@Puneet_Singh CurrentRow is only available within the For Each. If there is info you need to keep and use later (ie in the Catch block) you’ll have to create your own variables for the info, and use Assigns to populate them. Then use those variables in your email.
Thats what is meant by assign the variable? i.e. Assign the variable so that you can use outside of the For Each
Yes. Whatever values you want to use in your Catch block, you have to Assign to variables.
Another possibility would be to create a datarow variable, and Assign the entire row to the variable. Then you have the whole row to use in the Catch block.
Assign myRowVar = CurrentRow
Then you could do myRowVar(“SomeColumn”).ToString in the Catch block.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.