0

at the moment I'm facing a weird issue with the Process Builder and a @InvocableMethod annotated method.

The simplified method looks like this:

@InvocableMethod(label='Test Long' description='')
public static List<string> testLong (List<Long> inputParams) {
    System.debug(inputParams);
    List<string> results = new List<string>();
    return results;
}

When I create a process in the Process Builder and pass a small number into the method, the inputParams are passed correctly to the method. However, when I pass a large number, I get some strage values for inputParams, like -1773790777.

I suspect there's some kind of integer overflow happening, but the thing is, this has been working without any issues for some months now and we only discovered the issue today.

Does anyone know if something changed in the Process Builder or if this is a bug?

Best regards Patrik

0

Refer Rules of Conversion

Numbers form a hierarchy of types. Variables of lower numeric types can always be assigned to higher types without explicit conversion. The following is the hierarchy for numbers, from lowest to highest:

  • Integer
  • Long
  • Double
  • Decimal

Once a value has been passed from a number of a lower type to a number of a higher type, the value is converted to the higher type of number.

  • Thanks for the input Santanu. However, I'm not sure how this explains the behaviour of the Process Builder, especially because the exact same implementation used to work for months. – Patrik Jun 15 '18 at 12:24
  • check, what the values are getting passed to this method. What's debug showing – Santanu Boral Jun 15 '18 at 12:28
  • If I pass small values, debug shows the correct values, if I pass really large values (123456789999) debug shows something like -1773790777. – Patrik Jun 15 '18 at 12:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.