You need to sign in to do that
Don't have an account?
CarlB
System.UnexpectedException: Illegal arguments
Hello.
I am getting the above error in my code. However, the code used to work, so I am wondering if Salesforce have changed something recently.
My code is in a Visualforce controller extension:
I think the problem is that this controller is defined in a managed package which I have installed in another org and then I try to use the controller on an object that was defined in this other org.
However, I can't see why this should be an issue.
Any thoughts?
Carl
I am getting the above error in my code. However, the code used to work, so I am wondering if Salesforce have changed something recently.
My code is in a Visualforce controller extension:
abstract global with sharing class BaseExtension { protected SObject m_Object; public BaseExtension (ApexPages.StandardController p_Controller) { m_Object = p_Controller.getRecord(); if (m_Object!=null) { recordTypeId = (String)m_Object.get('RecordTypeId'); } } }Now, field 'RecordTypeId' does exist in the object in question.
I think the problem is that this controller is defined in a managed package which I have installed in another org and then I try to use the controller on an object that was defined in this other org.
However, I can't see why this should be an issue.
Any thoughts?
Carl
which line generates this error?
recordTypeId = (String)m_Object.get('RecordTypeId');
throws the error.
Carl
The class is giving you error in both orgs? or only in one?
However, if I create a managed package in org B (containing the new object) and install both managed packages into org C and run the same code, I don't get an error.
It seems to be that the error occurs when you run the code in the same namespace as where the object is declared.
Carl
I have the same issue.
Were you able to resolve it?
I have an Extension in OrgA, and an object in OrgB.
When executing the Extension in OrgB I get this error.
Both org's are a managed package.
I was able to fix this by re-instantiating the controller:
public ParticipantNewAndEditExtension(ApexPages.StandardController controller)
{
super(new ApexPages.StandardController(controller.getRecord()));
}