Options

Need a field in the Item table that derives from other field

Tan_Eng_SiongTan_Eng_Siong Member Posts: 84
Hi

I am trying to create a field in the Item table that derives from other fields in the Item table SUM(Inventory, Sales (Qty.) and another flowfield (I know to create flowfields))

How do I go about creating such a field? Do I have to make it calculate on all validate of the fields that it depends? I need the field to display the value accurately whenever the Item table is queried.

Thanks
Tan Eng Siong

Comments

  • Options
    HalMdyHalMdy Member Posts: 429
    I think it is better to put the calculation formula in the OnValidate trigger of your field. Remember to make a CALCFIELDS on the concerned flowfields before... Then, on OnAfterGetRecord trigger of the form where you want to dispay the field, simply call YourField.VALIDATE(YourField);
  • Options
    pdjpdj Member Posts: 643
    Or make a function that returns the calculated value. Then it can be shown directly in forms and reports. However, your method includes Captions, but I have to go and add them each time I use the function. So I guess it is pretty simular work. Nevertheless I prefer my way - it is more "correct", at least to me :-)
    Regards
    Peter
Sign In or Register to comment.