I am learning REFramework and getting this error [Queue Item Content: Can not assign 'Convert.ToDecimal]

I am learning REFramework and getting this error [Queue Item Content: Can not assign 'Convert.ToDecimal].

I am trying to assign decimal type variable Convert.ToDecimal(in_TransactionItem.SpecificContent[“Cashin”].ToString()), but getting below error.

Hi @lalitk3

Your syntax is wrong. It should be brackets(), not parentheses [].
i.e. Convert.ToDecimal(in_TransactionItem.SpecificContent("Cashin").ToString)

Kind Regards

Visit Topic

I put Convert.ToDecimal(in_TransactionItem.SpecificContent(“Cashin”).ToString) but now red symbol appear with error message: non invokable number queueitem.specific content cannot be used like a method.

My project is setup as C#, window legacy

Sorry, I assumed you were using VB.

To aid in debugging, use the immediate window to print the value. Type in in_TransactionItem.SpecificContent["Cashin"].ToString()

Additionally, see if you can get further error information by pressing continue.

The value coming is 8 when I put in_TransactionItem.SpecificContent[“Cashin”].ToString() to messagebox. And further error is in below image

image

Hmm, i’m not sure what the problem is, have you tried casting it instead?

(decimal)variable