Simplicty and flexibility!

DataEase 8.2 - Editable Form Virtual Fields (Ver.

Started by DataEase
You will need to Sign In to be able to comment on the Blog!

DataEase 8.2 - Editable Form Virtual Fields (Ver.

Download Sample

Earlier in the DE8 development we enabled Virtual Columns to be editable. You can question why this is a good idea, but the answer is that it is a VERY good idea.

In DE8 we change the way you search and manipulate the data via ExecDQL(), Memo and Set libraries etc.

Many places you simply need to have fields to input data to functions etc. Fields that never need to be saved, just need to be available there and then.

We and many users have already used the Virtual Columns exstensively, but what about the virtual fields that you can insert in Forms that doesn't define tables or directly into the Form object (outside the Record object) in forms that define Table?

In the attached sample (High/High to access it as developer), you will see a sample where we use a SearchField placed in the record object to search in a multi record layout. No reporting and no Subform here.

We use OML and GetValue() (OML extensively and don't be afraid of it any more. As long as the application is made FRESH in DE8 there is very little problems with OML).

We will discuss this sample and methods more in detail in an article, but we can introduce you to it now and see how much you can deduct from it yourself.

We also use SetLabelText(), GetVar()/SetVar(), SetStyle(), SelectionFIlter() etc.

Just as a taster, this is the OML script on the event LostFocus on The FormVirtualField SokeFelt which is the search field directly on the form object.

define "retval" text .

if lastc(SokeFelt.value,3) not ="..." and sokefelt.value not=GetVar("SokeFelt") then

retval := SetVar("SokeFelt",SokeFelt.value) .

retval := SetStyle(concat("label",GetVar("SearchField")),"Blue") .

retval := SetLabelText(concat("label",GetVar("SearchField")),GetVar("SearchField")) .

retval := SetStyle(concat("label",GetVar("SearchField")),"Red") .

retval := if (GetVar("SearchField")="CustomerNr", SelectionFilter(GetVar("SearchField"),concat("=",GetVar("SokeFelt"),"*")) ,SelectionFilter(GetVar("SearchField"),concat("=",chr(34),GetVar("SokeFelt"),"*",chr(34))) ) .

retval := SetLabelText(concat("label",GetVar("SearchField")),concat(GetVar("SearchField")," - (Search: ",GetVar("SokeFelt"),")")) .

end .

Written by DataEase 18/08/14 at 17:36:22 Dataease [{8}]FIVE