RE: Get SharePoint files information from related document entity.
If you are speaking about the Document section in the form entity (last tab), this is an iframe object that points to an internal SharePoint view.
Therefore, you won't be able to get results for the grid object by XRM, if not through not-supported JS code, but it's limited for the already showed informations in the view (name, path, createdby, modifiedon, etc...).
Dynamics stores only the related SharePoint folder position for the record, and not the details about the list files in it.
The files in it, are retrieve by internal query in the on load event of the iframe.
If you need to get details about the files in the folders, you can achieve this only by SharePoint API.