Error CS0019: Operator '<=' cannot be applied to operands of type 'decimal' and 'double'

, ,

Hi all!

This is my first time here and this is my first post.
I’m new in the Epicor world so please, let me know if my topic here is unclear!

I ran into an issue while modifying a BAQ embedded into a BPM.
The BPM is blocking users from confirming a PO when there are lines where the price is at zero. (table: PODetail / field: DocExtCost (type: decimal))
The embedded BAQ has a “constant” criteria filtering lines equal to 0, and it works just fine.

I now have to also filters lines who are equal or less to 0.01.

When I’m trying to save that modification, Epicor pops me that error message:
Error CS0019: Operator ‘<=’ cannot be applied to operands of type ‘decimal’ and ‘double’

The BAQ interface here is pretty limited, and it seems that I cannot create calculated fields…

Is there a way or any other strategy I could use for getting what I want?

Let me know if you need any other details!

Thanks in advance for your help :slight_smile:

Are you typing <= 0.01?

If so, then change it to <= 0.01M

5 Likes

Simple as that?!
Works like a charm!

Thanks a lot sir :slight_smile:

This is neat. I have not heard about adding the M like you did. What does it do?

From MS site [Floating-point numeric types - C# reference | Microsoft Learn]

image

So in the query designer in a BPM the literal without a suffix is a double, but the field being compared to is a decimal. Just by adding the “M” at the end treats both of the comparators as decimal.

3 Likes