Adding a customer defined table to Default Dimension

Hi,

I would need to manage dimensions on a customer defined table, but I can’t manage to insert a record with a 50000…99999 Table ID into table 352. Or so it seems.

I have tried many different workarounds - change SaveDefaultDim in codeunit 408, comment all the code in “Table ID” field in table 352, and such - but without succeeding. I keep getting a “There is insufficent memory (stack)…” error.

What am I missing? Is what I’m trying to achieve impossible? [^o)]

Hi Anna,

First thing, the stack out warning means that the code has entered an infinite loop.

How are you saving the default dims? Is there a Menu Item off the “Card” for your bespoke table?

What error do you get adding 50000-99999 into the Database ID?

I have just done some work around dimensions for some bespoke tables, so hopefully I can help.

T

Okay, I’m going to jump ahead slightly here, you might have tried this already.

Modifying Codeunit 408

You need to go to the locals in here and extend the TableIDArray Dimensions by how any tables you want to add to the Default Dimensions.

SetupObjectNoList(VAR TempObject : TEMPORARY Record Object)
NumberOfObjects := 23; ← Increase here are well. By the number of tables you want to add

TableIDArray[1] := DATABASE::“Salesperson/Purchaser”;
TableIDArray[2] := DATABASE::“G/L Account”;
TableIDArray[3] := DATABASE::Customer;
TableIDArray[4] := DATABASE::Vendor;
TableIDArray[5] := DATABASE::Item;
TableIDArray[6] := DATABASE::“Resource Group”;
TableIDArray[7] := DATABASE::Resource;
TableIDArray[8] := DATABASE::Job;
TableIDArray[9] := DATABASE::“Bank Account”;
TableIDArray[10] := DATABASE::Campaign;
TableIDArray[11] := DATABASE::Employee;
TableIDArray[12] := DATABASE::“Fixed Asset”;
TableIDArray[13] := DATABASE::Insurance;
TableIDArray[14] := DATABASE::“Responsibility Center”;
TableIDArray[15] := DATABASE::“Item Charge”;
TableIDArray[16] := DATABASE::“Work Center”;
TableIDArray[17] := DATABASE::“Service Contract Header”;
TableIDArray[18] := DATABASE::“Customer Template”;
TableIDArray[19] := DATABASE::“Service Contract Template”;
TableIDArray[20] := DATABASE::“IC Partner”;
TableIDArray[21] := DATABASE::“Service Order Type”;
TableIDArray[22] := DATABASE::“Service Item Group”;
TableIDArray[23] := DATABASE::“Service Item”;
TableIDArray[24] := DATABASE::"";

Object.SETRANGE(Type,Object.Type::Table);

FOR Index := 1 TO NumberOfObjects DO BEGIN
Object.SETRANGE(Object.ID,TableIDArray[Index]);
IF Object.FINDFIRST THEN BEGIN
TempObject := Object;
TempObject.INSERT;
END;
END;

That should allow you to add your tables into the Default Dimension Table.

I might be a bit ahead of myself, but thought I would try.

Let me know

T

Indeed! [:(]

Here’s the story of my life! I’ve been a computer programmer for more than 30 years by now! Not even a bad one, I’m told, but now and then I bump into something that doesn’t work… I bang my head on it for more than would be acceptable until I surrender to seek help. The very moment that my plea is out, I finally see the light - usually in the form of a very stupid mistake that was lying under my eyes all the time! [:@]

I had inverted the variable names in the validation code… they were maddly calling each other!

Thank you for being willing to help, forgive me for the waste of you time. [:$]

LOL,

Always happens that way. You get sucked in and can’t figure the problem out, then it suddenly hits you.

Glad its all worked out :slight_smile:

T