Solved

Other Tab Variant for form depending on grid column value

  • 11 October 2023
  • 3 replies
  • 77 views

Userlevel 2
Badge +1

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 

 

 

 

 

 

 

icon

Best answer by Marco Maat 23 October 2023, 15:34

View original

This topic has been closed for comments

3 replies

Userlevel 6
Badge +16

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

Userlevel 2
Badge +1

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

Userlevel 2
Badge +1