CreateDim for new default dimension

Now I want to add a new customized function into NAV 4.0 SP1, that is, 1) define one default dimension for Location, 2) If I select a location in SO/PO or Item Journal Line, the default Location dimension will be copied to the order’s document dimension or the journal line dimension. And then once it is posted, they will go to posted document dimension or ledger entry dimension.

I notice there are some relevant function or codeunit, not quite sure how to do the customization.

  1. Table 36 Sales Header have a function named CreateDim.


DATABASE::“Salesperson/Purchaser”,“Salesperson Code”,

DATABASE::Customer,“Bill-to Customer No.”,

DATABASE::Job,“Job No.”,

DATABASE::Campaign,“Campaign No.”,

DATABASE::“Responsibility Center”,“Responsibility Center”,

DATABASE::“Customer Template”,“Bill-to Customer Template Code”);

So I think I may add the similar function CreateDim( DATABASE::“Location”,“Location Code”,….) in the table

  1. Codeunit 408 DimensionManagement may also be customized. I change the function SetupObjectNoList and add Table Location into TableIDArray().

Besides the above change, I did nothing else. But it doesn’t work as expected. Do you guys have the experience to add the new default dimension like that? Thanks for your sharing experience and know ledge. Thanks very much!

no response? or do I need to explain more?

Hi Austin,

If no response by now, then you should properbly explain it a bit more.

Thanks Erik, I just solve the issue two days before…

The coding should be no problem. Why it doesn’t work is that I setup the default dimension for Location. Now it is ok. thanks again.

Erik, thanks. I have solved the issue two days before. The reason is that I setup the default dimension for Location by mistake. The programming should be no problem. Now it work well. thanks again.