Rest v10 metadata API

Rest v10 metadata API does not show the label names ? however the v4's get_module_fields method pulls in the label information. 

http://support.sugarcrm.com/Documentation/Sugar_Developer/Sugar_Developer_Guide_7.7/Integration/Web_Services/v1_-_v4.1/E… 

Is there an API which gives in the label information in v10.

Thanks

Divya

Parents
  • Hi Divya Priya Rajendran

    In V10 you can request for the metadata and filter the result by the module name, if you are using PHP see this link https://community.sugarcrm.com/message/88332-re-get-all-fields-of-a-module?commentID=88332#comment-88342 

    If you need to do it on sidecar use this:

    app.api.call('read','/rest/v10/metadata?type_filter=modules,fields&module_filter=Accounts');

    to test the line above, go to sugar, open the chrome developer tools and in the console put:

    var tt = App.api.call('read','/rest/v10/metadata?type_filter=modules,fields&module_filter=Accounts');

    tt.xhr.success(function(res){console.log(res.modules.Accounts.fields.name);})

    You get a response like:

    1. Object
      1. audited:true
      2. calculated:false
      3. comment:"Name of the Company"
      4. comments:"Name of the Company"
      5. dbType:"varchar"
      6. duplicate_merge:"enabled"
      7. duplicate_merge_dom_value:"1"
      8. duplicate_on_record_copy:"always"
      9. full_text_search:Object
      10. importable:"required"
      11. len:150
      12. massupdate:false
      13. merge_filter:"disabled"
      14. name:"name"
      15. required:true
      16. type:"name"
      17. unified_search:true
      18. vname:"LBL_NAME"
      19. __proto__:Object

    In the vname key it's the label name

    Hope this help

    Regards

Reply
  • Hi Divya Priya Rajendran

    In V10 you can request for the metadata and filter the result by the module name, if you are using PHP see this link https://community.sugarcrm.com/message/88332-re-get-all-fields-of-a-module?commentID=88332#comment-88342 

    If you need to do it on sidecar use this:

    app.api.call('read','/rest/v10/metadata?type_filter=modules,fields&module_filter=Accounts');

    to test the line above, go to sugar, open the chrome developer tools and in the console put:

    var tt = App.api.call('read','/rest/v10/metadata?type_filter=modules,fields&module_filter=Accounts');

    tt.xhr.success(function(res){console.log(res.modules.Accounts.fields.name);})

    You get a response like:

    1. Object
      1. audited:true
      2. calculated:false
      3. comment:"Name of the Company"
      4. comments:"Name of the Company"
      5. dbType:"varchar"
      6. duplicate_merge:"enabled"
      7. duplicate_merge_dom_value:"1"
      8. duplicate_on_record_copy:"always"
      9. full_text_search:Object
      10. importable:"required"
      11. len:150
      12. massupdate:false
      13. merge_filter:"disabled"
      14. name:"name"
      15. required:true
      16. type:"name"
      17. unified_search:true
      18. vname:"LBL_NAME"
      19. __proto__:Object

    In the vname key it's the label name

    Hope this help

    Regards

Children