Recently, we faced one issue on clicking Ok button on the form "Retrieve purchase orders". You select one or more order and click Ok button and the system throw the following error:
The method Set::difference cannot reference objects on different tiers
|(S)\Classes\PurchFormLetter_Invoice\purchSelectLines - line 44|
|(C)\Classes\PurchSelectLinesManager\passSets - line 21|
|(C)\Forms\PurchSelectLines\Designs\DesignList\Button\Methods\Clicked - line 7|
I checked with one of the other AX environments and the error does not appear there, it only appeared in AX 2012 CU6 environment. I am not sure if I am the only one facing this issue but could not find anyone else mentioning about this over internet.
Fix: Following is the fix applied for this:
Set the property "RunOn" of the class to "Server" [from Calledfrom] since the class "PurchFormLetter_Invoice" is run on server (modified on SYP layer) and the error simply says that both of them needs to be on the same tier.
Hope this helps.