
I have a table extension, which has a field I am wanting to validate against the list of dimensions available under Global Dimension 1. Here is a snippet of code where I am working this through:
Please note this is just for practise, not a production installation.
field(53003; "xDfltGlobalDim1"; Code[30])
{
TableRelation = "Dimension Value".Code where("Dimension Code" = field("Global Dimension 1 Filter"));
}
However this produces a list of ALL dimension values setup for both 1 and 2.
I want to go to the General Ledger Setup table to find out what the Global Dimension 1 Code is, then use that to filter the results from the Dimension Value table.
I would expect to be able to do something like this (but of course it doesn't work like that!)
TableRelation = "Dimension Value".Code where("Dimension Code" = field("General Ledger Setup"."Global Dimension 1 Code"))
Any assistance appreciated.
You just need to set it like this
TableRelation = "Dimension Value".Code WHERE("Global Dimension No." = CONST(1));