1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Donation with Paypal!!!

    Go to your paypal account and send directly donation to [email protected]

    1 month - 10 $ - Standart VIP

    6 months - 20 $- Standart VIP

    1 year - 30 $- Standart VIP

    2 years - 50 $- Standart VIP

    Gold member for life - 150 $- Standart VIP

    High Vip (Standart VIP include) group please send PM or email to [email protected] for info

    After Donation please send email to [email protected]

  3. Donation Ways 2020


    Paysend
  4. Telegram

  5. Delphifan Magazine
Dismiss Notice

Donation with Paypal!!!

Go to your paypal account and send directly donation to [email protected]

1 month - 10 $ - Standart VIP

6 months - 20 $- Standart VIP

1 year - 30 $- Standart VIP

2 years - 50 $- Standart VIP

Gold member for life - 150 $- Standart VIP

High Vip (Standart VIP include) group please send PM or email to [email protected] for info

After Donation please send email to [email protected]

Dismiss Notice
For open hidden message no need write thanks, thank etc. Enough is click to like button on right side of thread.

“No Code” Calculated Fields in RAD Studio and AppMethod

Discussion in 'Delphi Android And IOS' started by AdminDF, Aug 5, 2014.

  1. AdminDF
    Online

    AdminDFAdminDF is a Verified Member Delphifan Staff Member DF Staff

    In Perth last week I was showing the new FieldOptions property on datasets. As part of the demo, I had to create a calculated field, and when I brought up the New Field dialog an audience member suggested I create an InternalCalc field instead.

    I’d never heard of an InternalCalc field at the time, so later I did some research into what they are. In FireDAC they do everything a normal Calculated Field does, but in addition, you can define the value using the DefaultExpression property of the field, rather than having to write an OnCalcFields event handler.

    [​IMG]

    The New Field dialog, showing the 5 different types of fields you can create

    In the Object Inspector screen shot below, you can see I have a TStringField with its FieldKind set to fkInternalCalc and the DefaultExpression set to:

    LAST_NAME + ', ' + FIRST_NAME

    [​IMG]

    Object Inspector showing the DefaultExpression and FieldKind properties of my InternalCalc field

    This not only lets me avoid adding code for simple field calculations, but further, the calculated value is visible at design-time, unlike normal calculated fields.

    [​IMG]

    The InternalCalc field at design-time

    Thanks for Malcolm Groves.
     
  2. larbiparadox
    Offline

    larbiparadox DF Junior

    RE:

    Thanks
     
  3. akosinald
    Offline

    akosinald DF Member

    RE:

    thanks... that was informative... InternalCalc ftw!
     

Share This Page