You need to sign in to do that
Don't have an account?
Varun Chopra
Duplicate Field Selected Exception:
Hi
I am facing a wired issue in my clients org. There are two fields in the clients org with same label suppose ABC.
One from our package (xyz )and one in their own org. Our code is executing dynamic query using salesforce
Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap() method.
When the above query is executing salesforce is throwing the following error:
Duplicate Field Selected: xyz_ABC__c
For now I hvae fixed it by renaming the field label but is there anything that we can do in our code to fix this issue ?
Thanks In Advance !
I am facing a wired issue in my clients org. There are two fields in the clients org with same label suppose ABC.
One from our package (xyz )and one in their own org. Our code is executing dynamic query using salesforce
Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap() method.
Map<String, Schema.SObjectField> objectFields = Schema.getGlobalDescribe().get(objectName).getDescribe().fields.getMap(); string fieldnames=' '; for(String s : objectFields.keySet()) { s = objectFields.get(s).getDescribe().getName(); fieldnames+=s+','; } fieldnames=fieldnames.substring(0,fieldnames.length()-1); string query= 'SELECT '+fieldnames +' from xyz_sfObj__c'; List <xyz_sfObj__c> sfObjData = Database.query(query); //return fieldnames;
When the above query is executing salesforce is throwing the following error:
Duplicate Field Selected: xyz_ABC__c
For now I hvae fixed it by renaming the field label but is there anything that we can do in our code to fix this issue ?
Thanks In Advance !
Now this API version is not resolving the conflict between managed object and custom object with same name with namespace.
As per what I read, , Customer should not have a field with same name (packaged and unmanaged) on the same object, and is not recommended practice, hence their suggestion is to ask Customer to update Custom fields that have duplicate name. You can find more details here:
https://success.salesforce.com/answers?id=90630000000DNMeAAO
We are also aware that by the change in platform behavior and significant effort on Customer side to update fieldname is not feasible due to impact to other areas like workflow rules, custom apex classes, integration etc.