Skip to main content

Is it possibe to to change the table variant on a form depending on a value of a column ( for instance category )  ?

I have a screen type where theres is a grid on first tab and form and details on second tab. 

i created table variants for some categories  where i have a different setup for the form

and its details. ( other group labels  , different field order )   

 

now when i have selected a record and go to the form tab it shows the default form  

but i woold like the formlayout of one of the defined table variants 

 

 

 

 

 

 

Not by default. But you can simulate this with a double self reference toggling between reference 1 or 2 using the context procedure. You can then assign a different table variant to the reference. The reference columns are expression columns see the input below. Below is an example: 
 


 



Ref1 expression column =  case when t1.category = 1 then t1.x_id else null end
Ref2 expression column =  case when t1.category = 1 then null else t1.x_id end

 

Context: 

 

  

if @reff1 is null
begin
 set @ref_X_X_ref1_type = 2
end

if @reff2 is null
begin
 set @ref_X_X_ref2_type = 2
end


Solved it  by adding a table task that works on double clicking a record  in a grid only screen 

Task opens a variant according the category with screen with form and details.

But yours is interesting too