Field Type does not match (Code / OemCode)

einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
edited 2016-05-17 in NAV Three Tier
Hi all,

I face a strange issue. NAV 2013 R2 Database. A certified Add-on from a Partner is checking the Field Type of a field at a certain point in time. And it throws an Error Message that the Field Type doesn't match. It checks for Field Type OemCode, but my Field is Type Code. And the Option OemCode doesn't even exist in the selection.

I know it's somehow related to this topic https://krikinav.wordpress.com/2016/05/06/field-version-list-in-the-object-table/. But I don't know how to solve it.

Any ideas or explanations?
"Money is likewise the greatest chance and the greatest scourge of mankind."

Comments

  • Peter+is1Peter+is1 Member Posts: 174
    Hi,

    I am 100% not sure but it sounds like a code field from NAV 2009 did not upgrade correct to code in NAV 2013.

    Perhaps you can find where the error occurs and, if it is in the add-on, perhaps you can import a fob for that object that has not been modified by the upgrade process?

    Or you can try and export the object, that has the OemCode part/field in it, to text, modify OemCode to Code and import again.

    Hope this helps..
    \\
    The truth exists in seven versions.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Hi Peter,

    thanks for the answer. Not sure if I understand it correctly. The field that is checked is of Type Code, and there's no option to switch it to OemCode. But the Add-on checks for if the Field Type is OemCode. Obviously, this option is (or was) somehow available in background, otherwise it wouldn't be possible to check for that Option Value and compile the check function.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Peter+is1Peter+is1 Member Posts: 174
    Hi, I will refrase and try to be more clear.

    I understand that the fieldtype OemCode is not an option for you (it is most likely a leftover result from an upgrade of NAV). You need to get the OemCode out of your objects.

    Can you try one of my suggestions.
    a) import a original fob of the object that gives the error.
    b) can you export the object with the fieldtype OemCode to text and replace OemCode with Code?

    Hope this helps more.
    \\
    The truth exists in seven versions.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    It is exactly the other way round. The field is of Type Code but the Add-on checks for Type OemCode. And it really checks like FieldRef.Type::OemCode. Thus, this option is somewhere available in background although I can't select it in the Type property of the field. Otherwise it wouldn't be possible to compile the Object that contains this check, right?

    We didn't do any update. This is a new 2013 R2 Database. Probably the Add-on was developed in another version, but that I don't know.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Peter+is1Peter+is1 Member Posts: 174
    Hi,

    I will give it one last try.
    You need to replace anywhere and everwhere in the code FieldRef.Type::OemCode with FieldRef.Type::Code.

    Good luck.
    \\
    The truth exists in seven versions.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    Ok, now I got it. Sorry. Unfortunately this is in the No. Range of the Add-on, so I don't have any possibility to change that.

    On top of that, I also would like to understand the reason why it is like this. I think it's easier to search for possible solutions if the root cause of an issue is known.
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Peter+is1Peter+is1 Member Posts: 174
    Hi.

    it is most likely a leftover result from an upgrade of NAV. I am not 100 % sure but it sounds like a code field from NAV 2009 did not upgrade correct to code in NAV 2013.

    In your case you say the add on probably was upgraded?
    \\
    The truth exists in seven versions.
  • einsTeIn.NETeinsTeIn.NET Member Posts: 1,050
    I don't know in which version the Add-on was developed. But I think it's rather developed in a higher version than in an older.
    I thought OemCode is the most recent option value, isn't it?
    "Money is likewise the greatest chance and the greatest scourge of mankind."
  • Peter+is1Peter+is1 Member Posts: 174
    As far as I know. OemCode is only used by the upgrade process from 2009 to 2013.
    \\
    The truth exists in seven versions.
Sign In or Register to comment.