Problem with creating General Journal from report.

dannycdannyc Member Posts: 2
Hi All,

New Member Hope you can help.

Currently using Version4 Navision.

I have created a report which generates a General Journal using the insert command. Most of the data is transferred to the Journal however one variable which is a dimension will not transfer to the Journal. This variable is a code type.

I have confirmed within the report that the variable is holding the data prior to the insert command.

Can anyone help?

Regards Danny

\:D/

Comments

  • SavatageSavatage Member Posts: 7,142
    are you doing a VALIDATE somewhere, of anything, after the Dimension has been assigned?

    If so it's probably clearing the field.
  • SavatageSavatage Member Posts: 7,142
    For example only.

    Say I entered some sales lines now I want to do something to update a field in each line.

    If I Salesline.VALIDATE."No." I will lose my Quantity field.
    Unless store the value somewhere & bring It back.

    vStoreQty := Salesline.Quantity; //move it safe
    Salesline.VAIDATE."No."; //validate the field I wanted
    Salesline.Quantity := vStoreQty; //Move it back
  • kinekine Member Posts: 12,562
    dannyc wrote:
    Hi All,

    New Member Hope you can help.

    Currently using Version4 Navision.

    I have created a report which generates a General Journal using the insert command. Most of the data is transferred to the Journal however one variable which is a dimension will not transfer to the Journal. This variable is a code type.

    I have confirmed within the report that the variable is holding the data prior to the insert command.

    Can anyone help?

    Regards Danny

    \:D/

    Because the dimesnions are transfered into linked table, you need to insert first the line, than validate the dimension field on the line and make MODIFY(True). In this way the dimension will be saved correctly. It means you need to keep the steps like this:

    1) INIT
    2) Assign primary key fields (Template, Batch, Line No)
    3) Insert(True)
    4) Validate all other fields
    5) MODIFY(True)

    in this way you fully "simulated" the manual data entering and the result will be correct (if you validate the fields in correct order)
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
Sign In or Register to comment.