Unexpected token ILLEGAL with #CALC_SUM

Posted by koreem on 22-Apr-2015 09:44

I get the following error when using the #CALC_SUM method (client_side):

Uncaught SyntaxError: Unexpected token ILLEGAL

The method is working fine on server-side (trigger).

Full code:

<script>
var totalPrice = parseFloat(#CALC_SUM.R47972( total_price | true));
</script>  



Posted by pvorobie on 22-Apr-2015 13:37

#CALC_SUM lives on server-side and cannot be used in client-side script. Please use [tag:EVAL][] block to fetch server-side values to client-side script:

<script>

var totalPrice = parseFloat( [tag:EVAL][ #CALC_SUM.R47972( total_price | true) ] );

</script>

All Replies

Posted by pvorobie on 22-Apr-2015 13:37

#CALC_SUM lives on server-side and cannot be used in client-side script. Please use [tag:EVAL][] block to fetch server-side values to client-side script:

<script>

var totalPrice = parseFloat( [tag:EVAL][ #CALC_SUM.R47972( total_price | true) ] );

</script>

This thread is closed