Formula field that calls a function that seeks records from another form does not seem to be working

Formula field that calls a function that seeks records from another form does not seem to be working

Here is my scenario (simplified):

I have a function - GetCount(string Name) that queries a certain form collection say Form2 and returns the count.

I have another form From1 that has a formula field that calls the GetCount(Name) function.

When I introduce this formula field, it calculates the count and correctly shows me in the View of Form1 at the begining and then all the values stay as-is even though the records in the Form2 have changed. If seems to be that the formula field in Form1 was just evaluated once at the time of its creation. Thereafter changes in Form2 records are not getting reflected as I would have expected from a formula field.

Not just that, when new records are being added to the Form1 (on which the formula field is sitting) shows a blank value when new records are inserted into the Form1.

Regards
Moiz Tankiwala
Smart Training & IT Solutions