Options

Dataporting

mccizmt2mccizmt2 Member Posts: 21
Hi,

I dataport information to the item table, the description field has been lengthened by our contract developers to 80 characters, and if I create an item in Navision I can enter 80 characters. However when I dataport it refuses to transfer a description field that's longer than 60 characters. Does anybody know what's going on here, i would greatly appreciate any input.

Comments

  • Options
    ArhontisArhontis Member Posts: 667
    Hello,

    The dataport you use is yours or somebody else build it?

    I am asking cause in a dataport, if you are entering information with length larger than the field that accepts the data, the creator of the dataport could have enter something like:
    Description := COPYSTR(Text,1,60);
    
    to be able to get only the 60 first chars of the data in the file.

    So in your case you sould look for that kind of code in OnBeforeEvaluateField trigger of the dataport field, or OnAfterGetRecord of the dataitem of the dataport.
  • Options
    DenSterDenSter Member Posts: 8,304
    Also, your dataport may put the incoming value into a variable before it puts the value in the record. Check if that is the case and then check the length of that variable, which should be 80 in your case.
  • Options
    Joe_LittleJoe_Little Member Posts: 45
    If you find that the field is sufficiently long and is being truncated but you can't see where, try the following: Select dataport, fields and press F9 on the description (or whatever variable you may be bringing this information into). Check the onbeforevalidatefield trigger. If you see something like text := copystr(text,1,60) that is your huckleberry.
  • Options
    mccizmt2mccizmt2 Member Posts: 21
    Thanks for all your suggestions

    I made the dataport so that can't be the problem, what if the developer forgot to change the field length on another table where it appears. Would Navision allow you to enter 80 characters on one table and only 60 characters on another table where the same field is used?
  • Options
    Joe_LittleJoe_Little Member Posts: 45
    Yup. You would eventually get a text overflow message if you are transferring information from the 80 to the 60 and the text length was too long for the 60 though.
  • Options
    NaviTools.comNaviTools.com Member Posts: 88
    Hi,

    Changing a length of a field in one of heavily used tables such as Item isn't a good idea #-o

    If you do it, make sure partner used Navision Developers Toolkit's 'Where Used' functionality and changed all occurances related to the new length. In case of 'Item.Description' there are mostly tables that need a change.

    Have you used 'Description + Description 2' before extending the lenght to 80? These two fields are 30 characters long each. There could be some code from before that was limiting length to 60 characters?

    You could use 'Extended Texts' functionality. Its line is 80 characters long.
    http://www.NaviTools.com
    Documentation for Microsoft Navision
    E/R diagrams, Workflow diagrams, UML diagrams, process diagrams
Sign In or Register to comment.