I have a layout which consists of a portal to related records. I've duplicated the portal and listed only a summary field to show the totals of those related records (so far, so good).
But I'd like to "capture" the value of that summary field by copying it into a field on the layout (outside the portal).
Is this a filtered portal? You need a relationship that retrieves exactly the records you see in the portal. With the Sum() function, you can then copy the result for further calculations.
Summary fields and filtered portals play nice now, though it wasn't always the case. @Malcolm has the solution - just do your set field form the portal context and it will summarise visible (filtered) values only.
Sum() is a relationship-level function which will deliver a different result for a filtered portal.