This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Data type mismatch -- ERR #6 Line 1472> End If

Hi!

I got this error mesage (Data type mismatch -- ERR #6 Line 1472> End If) and I cant trace it.

Any thoughts!


Thanks!

  • 0  

    Hi. This error is the result of an error in an AppScript. Do you know how to reproduce the issue? It would likely be invoked via a transition or maybe via a script run in URL context.

    The line number is generally the line in the script invoked by the above method. If the script has include statements, then the line number is the effective line number if you added up the lines included up to that point in the script.

    In other words, if you include a script that has 1470 lines and your main script looks like this:

    Line 1: If...

    Line 2: End If

    You would get the error message you received reporting an error on line 1472.

    The issue is probably in the corresponding If statement but could be on the line preceding the End If.

  • 0 in reply to   

    Hi   I know the script and its being invoked using a notification, there is no if-statement on that line number , but there is might be an issue with the line preceding the end if, no syntax errors , all scripts are validated and valid in SBM composer !

  • 0   in reply to 

    If it is working on another SBM record, then compare the data in the records to see what might be different that could affect the script. If a change has been made to the script or something that it relies on recently, review the changes for what could be affecting the code.

    After that, if you really can't see where things are failing, add logging messages like Ext.LogInfoMsg to the parts of the code that may be working so that you can see how far it gets without error. The log messages can be reviewed in the Windows Application Event log.

    https://docs.microfocus.com/doc/Solutions_Business_Manager/11.8/ttts_extloginfomsgmsg

    Examples can be found in the doc too:

    https://docs.microfocus.com/doc/Solutions_Business_Manager/11.8/ttts_samplereadwritefields

    Once you get close to the error, you can then include values and type information into the log using functions like GetFieldValue, Is, IsObject, and TypeName to reveal more about your variables.

    You can use vbscript resources like this to help:

    Best practices can include adding LogInfoMsg calls at the beginning and exit point of each function/sub, reporting input values to functions/subs and data retrieved, and using a naming convention to help you ensure to manage the type of data in your variables.

    I like:

    • strVarName - Strings
    • intVarName - Integers
    • aprVarName - AppRecords
    • etc.
  • 0 in reply to   

    Thank you so much   I will follow your instructions and will go from there Slight smile