Customer Portal

Cannot convert 'string' to 'boolean'

Comments 5

  • Avatar
    admin
    0
    Comment actions Permalink
    Hi yichuansancun,

    Problem is in your if-statement using assignment operator "=":


    if ($out.0.Earning_col_31 = "401KMEM")


    Which means store "401KMEM" into $out.0.Earning_col_31. So that produces string, but if-statement requires bool.

    Please fix it to equality operator "==":


    if ($out.0.Earning_col_31 == "401KMEM")


    I hope this helps.
  • Avatar
    yichuansancun
    0
    Comment actions Permalink
    Thanks!!! I will try that :)
  • Avatar
    yichuansancun
    0
    Comment actions Permalink
    Hi again,

    This time, I am getting error "Unreachable code" :(


    $out.0.* = $in.0.*;
    if($out.0.MilitaryStatusName == "not found") return 1; else return 0;
  • Avatar
    imriskal
    0
    Comment actions Permalink
    Do you have any other return statement in this specific CTL code? Or any other code after the return statements? This would explain the error message. If not, send me the whole CTL code please for me to better localize the issue.

    Thanks.
  • Avatar
    yichuansancun
    0
    Comment actions Permalink
    I had
    return all
    at the end of the function, which caused issue. I removed it and now it worked, thanks!

Please sign in to leave a comment.