Method Not found in Invoke Code

Dear Experts,

I am getting the following error “Method not found” in Invoke Code Activity

Error ERROR Validation Error Method not found: ‘Microsoft.CodeAnalysis.SyntaxTree Microsoft.CodeAnalysis.VisualBasic.VisualBasicSyntaxTree.ParseText(System.String, Microsoft.CodeAnalysis.VisualBasic.VisualBasicParseOptions, System.String, System.Text.Encoding, System.Collections.Immutable.ImmutableDictionary`2<System.String,Microsoft.CodeAnalysis.ReportDiagnostic>, System.Threading.CancellationToken)’. GrnBlanks.xaml

image
image

this is the code in invoke code activity

dt_Test.AsEnumerable.ToList.ForEach(Sub(row) row(“Document Number”)= convert.ToDouble(row(“Document Number”).tostring)

also I tried this

dt_Test.AsEnumerable.ToList.ForEach(Sub(row) row(“Document Number”)=cdbl(row(“Document Number”).tostring)

I am removing the leading space, I am not sure earlier it was working, now it is giving the error mentioned above.

Sample Data

Document Number
0094292946
0094293509
0094295713
0094296673
0094297071
0094297076
0094296060
0094295507
0094295510
0094295833

Appreciate your feedback on the same.

Regards,
Manjesh

@manjesh_kumar

have a look here to check if another approach is more convenient for your case
How to Update Data Column Values of a Data Table | Community Blog

Which versions are in use:

  • UiPath Studio
  • Package: UiPath.System.Activities
  • Package: UiPath.UiAutomation.Activities

in case of newer items are involved, Which Project Target type was selected?

Hello @ppr ,

I have only only column in the data table.

These are the verisons

image

Regards,
Manjesh

As discussed in the Blog the for each XX approach is a preferred one. There should be valid reason e.g. to do it with invoke code.

if an invoke code approach is selected then just do it as described on:


Section 1.2

we would also recommend to have different names on Argument and Variable (in your screenshot dt_Test)

Dear Peter,

Good Day.

The earlier issue I have resolved by writing a for loop however I would like to keep it with less code and that is the reason to use invoke code.

I am getting this error for another invoke code, which I had incorporated in earlier workflows.

inoutdt_DailyAttendance.AsEnumerable().Where(function (row) row.Field(of string)(“Status”).ToString.Equals(“SP”)).ToList().ForEach(sub(row) row.Field(of string)(“Comments”)=“Single Punch (only in or out time captured)”)

image

image

I would like to know what is root cause for this kind of error where it was working earlier and now it doesn’t work. Is this because of the higher version of the system activities

Appreciate your valuable feedback.

Regards,
Manjesh

currently we do see reports by forum members mentioning this issue. You can search on forum for this issue. Please list down for this also UiPath Version / edition and the versions of UiPath.System.Activities, UiPath.Automation.Activities and when used later versions the project type (e.g. Legacy…)

So we can try it for replicating the issue at our end.

In case of it cannot be sorted out, we can get in touch with UiPath Tech Team.

But coming back to your case:

in the referenced blog from above you will have some options / alternates for doing it. We would recommend also to check this approach:

Dear Peter,

The uipath studio version is 20.10.9 (Enterprise License)
Uipath.System.Acitvities = 21.10.3
Uipath.UIAutomation.Activities = 21.10.4

Hi,

The following post might help you.

Regards,

1 Like