SugarCRM API Metadata endpoint. Properties - How to define an updatable field?

Hi,

When querying the /rest/v11/metadata?type_filter=modules endpoint we can see the list of fields under the /fields object.

Some fields have the property "readonly", as the name implies this defines if this field can be used on Create/Update endpoints.

Some other fields do not have the read-only property, but have a property "type" set to link, relate, another module name, etc.

On the other hand,  most of them have the source=non-db, but some of these fields are updatable.

Some others can not be used in Create/Update, the server does not throw an error, but again the values are ignored.

As far as I've seen this has to do with 1-1 or 1-* related fields/modules or calculated fields.

The question is: How can I precisely define if a field is read-only or not from the metadata? What are all the combinations of properties to make a field read-only?

Thanks!

Parents
  • To the best of my knowledge (and I am by no means an expert about metadata) the read only in the metadata definition is only for those fields that are inherently read only like calculated fields. 

    When it comes to what the user can read-write it is not controlled in the API itself but by the ACLs, the user's Role dictates whether they have access to that field and in what capacity.

    There is very little control in the APIs themselves and you need to be very careful to enforce the quality of your data in the construction of the API's payload itself.

    There is, for example, no check inside the API that an enum value is valid, or that dependencies are enforced, those are all enforced by the user interface, not the underlying APIs.

    Does this answer your question?

    FrancescaS

    PS. you can find more information about the data framework Sugar uses here, though perhaps not in as much detail as you are looking for:

    support.sugarcrm.com/.../

Reply
  • To the best of my knowledge (and I am by no means an expert about metadata) the read only in the metadata definition is only for those fields that are inherently read only like calculated fields. 

    When it comes to what the user can read-write it is not controlled in the API itself but by the ACLs, the user's Role dictates whether they have access to that field and in what capacity.

    There is very little control in the APIs themselves and you need to be very careful to enforce the quality of your data in the construction of the API's payload itself.

    There is, for example, no check inside the API that an enum value is valid, or that dependencies are enforced, those are all enforced by the user interface, not the underlying APIs.

    Does this answer your question?

    FrancescaS

    PS. you can find more information about the data framework Sugar uses here, though perhaps not in as much detail as you are looking for:

    support.sugarcrm.com/.../

Children
No Data