Define a calculation field in the layout's table that uses the Sum function to compute the same portal total. This assumes that you are using an unfiltered portal as this calculation will ignore any filtering. It should update smoothly where a summary field needs scripted help to update. (I would guess that your script needs to commit records and then maybe refresh the window before you get the needed total.)
That did it, thanks
Is there a work around for the filter , I have added a filter to the portal which was needed, but now it does not update the s_time.
What is the filter expression?
Should cause the summary field to update.
If you put the summary field inside a one row portal that refers to the same related table and uses the same portal filter expression, the summary field will display a value based on the related records that pass the filter.
But many filter expressions can be replaced by a new relationship with additional match fields and this can often be a better option to use.
the portal filter is
(Employee_Course::fk_id_courses = Employee_Course::g_trainingFilter) or (IsEmpty(Employee_Course::g_trainingFilter))
The script is
I have the script set as script trigger on total time. Not sure about that one
Going just by the name, total time is probably a summary or calculation field, a trigger on that field is very unlikely to be tripped. You need this trigger on a field inside the portal that you edit to produce a different total. OnObjectSave is a typical trigger to use unless the field is formatted as a pop up menu, check box or radio button field. In those cases, OnObjectModify can be a better option.
It's possible to replace this filter expression with match fields and calculation fields that produce the same result.
Ok those script trigger are working fine, but
one last thing, I have also added a little drop down filter on the outside of portal and it is working fine, when I select something it narrows the portal down to just that, however , the s_time field on the outside of the portal will not update.