BIP 'number' function error

cbudoris

Active Member
I'm putting this out there in case anyone encounters a similar problem. It relates to our check template (R04572), but the problem could happen in any template.

We had this logic on a template (supposed to control whether a signature image printed):

<?choose:?>
<?when: (number(Total_Payment_Amount___Local_ID6) < 500000 and TORG_3_ID40='ARI') or (number(Total_Payment_Amount___Local_ID6) <= 50000 and TORG_3_ID40!='ARI')?>

The problem lies in the 'number' function around the total payment variable. When you use the Conditional Region tool to build the logic, it automatically puts that 'number' function around the variable. It looks like its attempting to cast that variable to a number, but the fact is that its already defined as numeric on the UBE, so it probably wasn't necessary. This renders fine as long as that variable 'Total_Payment_Amount___Local_ID6' is present on every page of the XML. But if you have a check with more than 10 lines of detail, you'll get multiple pages, and that variable is only present on the last page. For some reason, the template doesn't like that, and simply doesn't render on the server (renders fine on the development client, which makes this all the more puzzling).

To resolve, take that 'number' function out. So it would read as follows:

<?choose:?>
<?when: (Total_Payment_Amount___Local_ID6 < 500000 and TORG_3_ID40='ARI') or (Total_Payment_Amount___Local_ID6 <= 50000 and TORG_3_ID40!='ARI')?>

Now the template doesn't care if that field is not there, and renders fine on the server.

Hope this helps somebody- it was a #$%@ to find!
 
Back
Top