how to get selected from listpart page which in the Card page

HI All.

There are two pages. One is listpart page with the codes underneath :
Function GetSelectedItems (Var ContainerHeader : “Container Header”)

The other page is Card page with the codes underneath

In the action of the page:
If ContainerHeader.FindSet Then Begin
Message(format(ContainerHeader.“Container No.”));

I know in the form some similar codes work fine. Why Can not get the right selected items in the page?

Any suggestions?

Thank you all in advance.

I just searched about the issue. I found this link : Indeed, What I get from the selected items in the subfrom always be the first record in the listpart. Not the right selected items. If there is any other solution except for moving the function to the subfrm control ?.