You need to sign in to do that
Don't have an account?
CarlB
Dynamic query yields incompatible SObject type
Hello.
I have a managed package that is build on another managed package. In particular I have interfaces in one managed package that extend (global) interfaces in the other managed package (e.g.
Normally this doesn't cause a problem, but recently I tried to install my managed package in an org and the install failed saying the method A() didn't exist in interface B, which clearly it does.
I got around this by changing my code to explicitly reference interface A rather than interface B, e.g.
This got around the problem, but once I had uploaded a new version of managed package B, some of the unit tests started failing with the error:
Can anyone offer a workaround?
Regards,
Carl
I have a managed package that is build on another managed package. In particular I have interfaces in one managed package that extend (global) interfaces in the other managed package (e.g.
MANAGED PACKAGE A: global interface A { void A(); } MANAGED PACKAGE B: global interface B extends A.A { })
Normally this doesn't cause a problem, but recently I tried to install my managed package in an org and the install failed saying the method A() didn't exist in interface B, which clearly it does.
I got around this by changing my code to explicitly reference interface A rather than interface B, e.g.
ORIGINAL CODE: B b = .... b.A(); NEW CODE: B b = ... A a = (A)b; a.A();
This got around the problem, but once I had uploaded a new version of managed package B, some of the unit tests started failing with the error:
Dynamic query yields incompatible SObject type B.B for loop variable of type A.AThese unit tests worked before, but it seems that Salesforce has go in a mess.
Can anyone offer a workaround?
Regards,
Carl
In my parent managed package (A), I had some code that included this:
The listOfAs included instances that implemented B. The exception was thrown by the "for..." line.
By changing the code to
It worked.