Add a new dimension to all entry's

Hi All

I need to add a new dimension to all entry's, if a dimension already exist.
If dimension = x then insert a new dimensioncode/value. Only add, not replace, so Dimension Correction Tool is not useful.

Please advice best practice for this task, thanks in advance :smile:

Best Answer

Answers

  • SIPASIPA Member Posts: 6
    Hi beckindenmark,

    to be honest I don't know how much assistance you need but in general a process like the following will fit:
    LedgEntryDim.INIT;
    LedgEntryDim."Table ID" := DATABASE::"YOUR LEDGER TABLE"
    LedgEntryDim."Entry No." := YourLedgerTabel."Entry No.";
    LedgEntryDim."Dimension Code" := YourDimensionCode;
    LedgEntryDim."Dimension Value Code" := YourDimensionValueCode;
    IF LedgEntryDim.INSERT(TRUE) THEN;
    

    The "IF INSERT(TRUE) THEN"-Part will tell NAV to try to insert it. If caused by trigger or key error it is not possible, it will simply ignore this record.
    In this way you wouldn't overwrite other dimensions.

    I neither know if it is the correct table nor if it is what you meant, but for your purpose of not updating this example should work.

    Best regards
    SIPA
Sign In or Register to comment.