I am getting this error in the **invoke code. ** I have checked many times however I could not really find what is causing this error (BC30198 ‘)’ expected at Line 1
in_dt_dsrDtRaw.AsEnumerable().ToList().ForEach(Sub (row) If(row(“INVOICE_NUMBER”).tostring.substring(0,3)=“950”,row(“BILLED_QTY”)=0 And row(“LOCAL_CURR_AMOUNT”) = row(“LOCAL_CURR_AMOUNT”) * -1 And row(“NET_AMOUNT”)=row(“NET_AMOUNT”) * -1,row(“BILLED_QTY”) And row(“LOCAL_CURR_AMOUNT”) And row(“NET_AMOUNT”)))
I need to check for a condition if the INVOICE_NUMBER has certain numbers after getting the first 3 characters converting it from number to string, then update the other columns with certain values else retain the same values.
in_dt_dsrDtRaw.AsEnumerable().ToList().ForEach(Sub (row)
If(row("INVOICE_NUMBER").tostring.substring(0,3)="950") Then
row("BILLED_QTY")=0
row("LOCAL_CURR_AMOUNT") = Double.Parse(row("LOCAL_CURR_AMOUNT").ToString) * -1
row("NET_AMOUNT")=Double.Parse(row("NET_AMOUNT").ToString) * -1
End If
End Sub
)
If operator can have just value (not multiple expressions), as argument. In addition, in Vb, = means comparison operator and assignment operator, and it will work as comparison operator in your expression (against your intention).
So we need to use If statement with multi lines, in this case.
Or Where method (which @ashwin.ashok shows) also good approach.