Error in BPM Designed Query

We have quote follow-up reminder emails working fine with one exception - we get the emails even if a quote has been won or lost. I have beaten my head against a wall attempted to use a Condition to test for that but failed miserably, so any help is appreciated. (note: I am generally trying to do as much as possible using widgets other than “Execute Custom Code” since I don’t know C#). The BPM has one variable (string) and has the following steps:

  • Condition Widget: Checks for a row being added to ttAlertQue
  • Condition Widget: Checks if AlertNum is equal to ‘1030’. If true, then:
  • Set Arg/Var Widget: Sets variable ‘quoteNumber’ equal to ttAlertQueRow.AlertText .Substring(7,5)
    Example value: Full AlertText is “Quote (12268 ) - Follow Up Date 11/9/2022” and the substring sets the variable to 12268
  • Condition Widget: Testing for ‘number of rows greater than 0’ in the designed query.
    I am trying to use two Table Criteria:
    - first one (no issue): ReasonType = ‘’
    - second one (the problem): QuoteHed.QuoteNum = quoteNumber variable
    but when I try to save the BPM I get this error:

There is at least one compilation error.
PostTran.Global_Alerts.cs(145,28): error CS0019: Operator ‘==’ cannot be applied to operands of type ‘int’ and ‘string’

I have tried ‘Matches’ for the criteria and that throws
‘Matches’ comparison operator is not supported for ‘System.Int32’ type
Parameter name: compareAs

Should I be using a different type of variable? If I can’t use int or string I am not sure what else to use for quoteNumber. Other ideas or is there other info that is needed to assist? Thanks!

I am also happy to hear other/better ways to do this… but would really like to understand why the above doesn’t work.

@dmccann You need to use CAST or Convert on the QuoteNum to make it a string for the compare.
This is an example with OrderRel.OrderNum and OrderRelNum

image

Thanks @gpayne… makes sense I’m not sure where to do that? From your screenshot it looks like you are choosing the variable on the left and then able to use CAST on the right side. I noticed that the column headers on your say “or any expression” whereas mine say specifically “field” and “filter value”. Am I maybe just using the wrong widget/tool/whatever?

My ‘designed query’ dialog from my condition widget looks like this:

Set your quoteNumber variable in Set Argument/Variable to an integer.
In the specified expression set it to Convert.ToInt32(ttAlertQueRow.AlertText .Substring(7,5))

Now you are comparing integers.

@dmccann Sorry, I did not open that widget when I copied the expression. Given the limited choices to filter by @klincecum is correct that you need to convert it to an integer to use therre.

Works great - thank you!

1 Like