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
  • Thanks for the feedback. Yes, the user ACL is one point.

    Let's say we have an admin user that has all the required access to all CRUD operations.

    What happens is that this user cannot update the properties of a child object.

    For instance:

    module name: SugarFavorites

    Not allowed update on: Account_Name

    Allowed update on Account_id (this will update the Account_name under the hood since it's a foreign key)

    This looks like a DB constraint depending on the data model/schema. I'd like to know based on what metadata properties combination I can throw an error to my users when trying to update/insert those fields.

  • SugarFavorites does not have an Account_name/Account_id

    aside from that, I don't think you can tell from the metadata what the DB-level constraints may be.

    Francesca

Reply Children