I am trying to write C# code using invoke code activity with C# but when I am creating function it is not working and stating that “No compiled code to run”. Below is the example
I understand that each Invoke Code Block is a Function or Method, as it has both Input and Output variables, that is, you need to create your code routine inside this Invoke Code Block. As far as I know, UiPath doesn’t offer within this activity the possibility of writing classes, methods or functions.
Thank you @Jorge_Cavalcante for replying on my query.
There is one function which I need to call recursively to get the last ID details.
Could you please help me how I can achieve this ?
Hey,
if you have code in C# (class, methods or function) you can use it inside invoke code block.
Firstly you have to import all namespaces which you use:
Hello Ankit, @Jorge_Cavalcante is right, the C# code, inside a Invoke Code Activitiy, is like a Main method of a class. To meet your requirements you can use Lambda functions.
I learned a little more from your answer. I never thought of using Lambda Functions in this scope. I believe I will use the Invoke Code activity a lot more from today.