You need to sign in to do that
Don't have an account?
Dynamic Visualforce Bindings Working In One Org and not Another
I have a visualforce component utilizing dynamic bindings that I would like to use in multiple orgs. Everything works great in one org, but when I move it to another, I receive the following message after the component attempts to rerender itself:
Could not resolve the entity from <apex:inputField> value binding '{!obj[fieldName]}'. inputField can only be used with SObject fields.
The code is as follows:
<apex:inputField value="{!obj[fieldName]}" rendered="{!obj[fieldName] != otherValue && obj[fieldName] !=otherMessage}">
<apex:actionSupport event="onchange" reRender="thePanel" action="{!processSelection}" status="status" / >
</apex:inputField>
"obj" is a reference to a generic sObject in the controller, and "fieldName" is a String in the controller.
I find it interesting that the visualforce page compiles and saves, and that it only throws this error when it attempts to reRedner. I checked to ensure that the API version of the page the component is on, the component itself, and the component controller is the same in both orgs.
Thanks in advance for any insight!
Is the fieldname valid and the field accessible to the user in the org where it doesn't work?
Aballard,
The field name is valid and I am the system administrator, so I should have access. I checked my profile and I have access to the object, access to the field in FLS, and access to the Apex Controller.
Another reason why I know the fieldname is valid is that when the page first loads, the inputField renders the selectList with the correct options as expected. It is only when the component reRenders that I get this message.
It seems to me a namespace issue.The org where it is not working must have installed a managed package with namespace.
Shashikant,
It seems to me that both orgs have installed many managed packages. If this is a namespace issue, how can I resolve this? None of my classes or pages reference any managed packages.
Does either the org where it works or the one where it doesn't have its own namespace?
The org where the code does work has its own namespace, i.e. namespace.cs3.my.salesforce.com..... The org where the code does not work does not have a namespace. However, I do not reference any namespace in any code. I recreated the necessary clases and pages and copied the code over manually, I did not use a package of any kind.
So now that I know that one org has a namespace and the other does not, how do I fix this issue in the org without a namespace?
You may have to enter a support case... nothing obvious here.