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 !