Search This Blog

Wednesday, March 21, 2012

Dynamic Field Visibility Control

This is a development best practice. You might already know this, however for those people who never used it; this will become handy for you.

There is a configuration page and you want to define what all fields need to be visible or invisible based on certain key values. The field names are stored in the physical table.

Then on the target page, do a CreateSQL and get the field names with the key values passed to it. Then in the while loop you can use the code snippet below. And the requirement is done.

&Field_Control = CreateSQL("”YOUR SQL”);
While &Field_Control.fetch(&Field_Name)
&record.GetField(@("field." | &Field_Name)).Visible = False/True;
End-While;

@ is the game setter here :)

No comments:

Post a Comment