Infopart action fails when listpage dataset row is in a different company than the user.


I’m having quite a bit of trouble and hoping someone might be able to steer me in the right direction. It’s a bit complicated to explain and there’s no code involved, so please bear with me.

I have a custom list page with a cross-company data source that includes all InventTable records across all companies, linked to their EcoResProduct record.

On this list page, I have a custom fact box. The query for the fact box has two custom tables, neither of which are set to save records per company. However the top level datasource in the query has a 1:n relationship (InventTable:CustomTable) on ItemId and DataAreaId (where DataAreaId on CustomTable is not a system field but rather like RefCompanyId on DocuRef table). The infopart is linked to the list page datasource by this relation.

So far this all works fine. When I set focus on an item in a company other than my current one, the fact box shows the appropriate related records. Where it goes awry is on the infopart’s action.

I have an action configured to launch a secondary form with the same dataset should the number of rows exceed the available space in the fact box. This secondary form uses the same exact AOT query as the fact box’s infopart. This works correctly when the InventTable record in the ListPage is in the same company as I am. The secondary form opens up with the complete dataset I am expecting.

However when the InventTable record is in a different company than I am, clicking on the action gives me an infolog warning that the company is changing to the one on the InventTable record. Then I immediately get another warning indicating that the company has changed back to my current company. The secondary form never launches. In debugging, I know that it never even hits the init method on the secondary form.

I put a breakpoint in the Application.setDefaultCompany method to get a call stack, and found that the company change and related infolog messages are getting triggered by FormRun.activate, which I cannot debug further. But here’s where it gets really weird. While I have the break point in, the secondary form does launch with the appropriate dataset between the two calls to setDefaultCompany.

At this point I am at a loss as to how to resolve this. Prior to writing this post I did a full x++ compile, deleted the XppIL directory and did full CIL compile/database syncs. No errors.

I’m hoping someone may have an idea on how to resolve this, or even some additional troubleshooting ideas I might try.

Thanks in advance!