Campos de un sObject en Salesforce


/ Published in: Other
Save to your folder(s)



Copy this code and paste it in your HTML
  1. Map<String,Schema.SObjectField> mapaCampos = Schema.SObjectType.sObjectACAMBIAR.fields.getMap();
  2. List<String> listaCampos = new List<String>();
  3. for(String campo : mapaCampos.keyset()){
  4. listaCampos.add(mapaCampos.get(campo).getDescribe().getName());
  5. }
  6. listaCampos.sort();
  7. String stringADevolver = '';
  8. for(String item : listaCampos){
  9. if(item != 'TotalPrice'){
  10. if(stringADevolver.length() > 1)
  11. stringADevolver += ',';
  12. stringADevolver += '' + item + '';
  13. }
  14. }
  15. system.debug(stringADevolver);
  16.  

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.