Hello all I am working on my first upgrade to 2013 r2 that I have inherited and trying to upgrade a database with a lot of dimension based modifications, no documentation and the client has no clue about what has been done under the covers for them. I have just started with 2013 and only done one other upgrade at this time. I have my c/side solution development in nav 2013 and chapter 8 - Module Dimensions open but I am having some trouble understanding how I should use the new calls to upgrade the following code. I have searched and been trying for a few hours but I am not getting the same results as used to occur on NAV 5. I know this is surely trivial for some but any inputs would be much appreciated; I'm sorry to say that the majority of my experiance with dimensions has been in setup and reporting. I have been just fine adapting to other changes but could really use some help here.
#-o
Thanks in advance for any and all replys
Current Code ::
Function UpdateDimensions() is on table 38 Purchase Header and I have just about the same function on the lines; I should also mention the customer no. is the same as global dim 2. Thats why there is the call from the customer.
Vars:Name | DataType | Subtype | Length
GeneralLedgerSetup | Record | General Ledger Setup
Customer | Record | Customer
DefaultDimension |Record | Default Dimension
DocumentDimension | Record | Used to be Document Dimension Table 357
ChangeDimensions()
IF Customer.GET("Shortcut Dimension 2 Code") THEN BEGIN
GeneralLedgerSetup.GET;
DefaultDimension.SETRANGE("Table ID", 18);
DefaultDimension.SETRANGE("No.","Shortcut Dimension 2 Code");
IF DefaultDimension.FINDFIRST THEN REPEAT
IF DefaultDimension."Dimension Code" = GeneralLedgerSetup."Global Dimension 1 Code" THEN
VALIDATE("Shortcut Dimension 1 Code", DefaultDimension."Dimension Value Code")
ELSE
IF DefaultDimension."Dimension Code" <> "Shortcut Dimension 2 Code" THEN
IF DocumentDimension.GET(DATABASE::"Purchase Header","Document Type","No.",0,DefaultDimension."Dimension Code") THEN BEGIN
DocumentDimension.VALIDATE("Dimension Value Code", DefaultDimension."Dimension Value Code");
DocumentDimension.MODIFY(TRUE);
END ELSE BEGIN
CLEAR(DocumentDimension);
DocumentDimension.VALIDATE("Table ID",DATABASE::"Purchase Header");
DocumentDimension.VALIDATE("Document Type", "Document Type");
DocumentDimension.VALIDATE("Document No.", "No.");
DocumentDimension.VALIDATE("Line No.", 0);
DocumentDimension.VALIDATE("Dimension Code", DefaultDimension."Dimension Code");
DocumentDimension.VALIDATE("Dimension Value Code", DefaultDimension."Dimension Value Code");
DocumentDimension.INSERT(TRUE);
END;
UNTIL DefaultDimension.NEXT = 0;
END;
Thanks again for any help.
Comments
According to this I suggest to modify your function as follow:
Hope it works fine, I'm in a hurry and I didn't test it :oops:
I will post back and let you know how the testing turns out.
Thanks again so much for the help