FlowField update on a form

Hi, all
I’m facing the following problem in Dynamics 2009 R2 Classic, sqlsrver, database 5.0 converted.

On Purchase Header (38) I’ve added a flowfield based on a customized table. The flowfield is shown on the Purchare Invoice form. When the user enters a value on a certain field, which is the key to calculate the flowfield, this should be updated. Easy, no?

Well, no. The form (51) has the UpdateOnActivate property set to Yes (as all the form of this kind have) and the only way to see that damned flowfield to show the correct value is to click on a line in the subform and then click back on the header.

Nothing of that I’ve tried so far (CurrForm.UPDATE, CALCFIELDS + CurrForm.UPDATE, CurrForm.ACTIVATE) seems to work.

Any idea, guys and gals?

Thank you

Anna

Inside the form based on related table, try using a record variable which trigger the flowfield calculation like this:

recCustomTable.RESET;
recCustomTable.SETCURRENTKEY(“Document Type”, “Document No.”, “Line No.”);
recCustomTable.SETRANGE(“Document Type”, “Document Type”);
recCustomTable.SETRANGE(“Document No.”,“Document No.”);
recCustomTable.CALCFIELDS(“Your Field”);

And call this code in OnAfterGetCurrRecord of the SubForm.