'SAP B1: How to set LinkedObjectType for existent column

In our database, User Defined Fields in the Production Order rows define linked Production Orders and Purchase Orders. The columns for these fields on the Production Order window really should have golden link arrows.

If I created the columns myself, I would set the LinkedObjectType properly and the arrows would appear. However, in this case the B1 client creates the columns automatically. I need to get them and add the link arrows after form creation has completed.

The Production Order items grid is a Matrix, which offers the Columns property, so I can retrieve any column I want; however, it is returned as a plain Column object, not an EditTextColumn, so the LinkedObjectType property I need to set is not available. Attempting to cast the Column to an EditTextColumn simply causes an exception.

What is the correct way to add link arrows to a UDF column on the Production Order screen's matrix?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source