Scripting

  • 1.  Good evening - I have a simple script that calcula

    Posted 11-01-2018 22:15
    Good evening - I have a simple script that calculates Qty Ordered * Item Category 2 and Qty Ordered * Item Category 4 in Sales Order Entry (the script checks to make sure the values in those fields are numeric first) and then sets the resulting values in two new numeric SO Detail UDFs. I am getting an ""Overflow: Cint"" error when attempting to put in a Qty Ordered for any item where either Category field is 5 or more characters. So for instance, an item has a ""Pallet Qty"" (Category 4) of 30000 - I will get the error. I change it to 3000 in Item Maintenance and no error. I have changed my 15 digit numeric UDF masking a few different ways (i.e. #,###,### or ##########) but that doesn't seem to be making any difference. Any suggestions on what I am missing? Thanks in advance!


  • 2.  RE: Good evening - I have a simple script that calcula

    Posted 11-01-2018 23:37
    Your message indicates the ""CInt"" function is used which has a limit of a -32,768 to 32767. Use ""CLng"" instead of ""CInt"".


  • 3.  RE: Good evening - I have a simple script that calcula

    Posted 11-02-2018 05:33
    Thank you, Dan! I had no idea there could be a limitation like that. The change worked. I just hope I remember that next time I need it. Thank you again!