I
I
Ivan Shumakov2019-06-25 16:24:57
Bitrix24
Ivan Shumakov, 2019-06-25 16:24:57

How to block a field using the REST API?

BX24.callMethod(
      "crm.contact.fields", 
      {}, 
      function(result) 
      {
        if(result.error())
          console.error(result.error());
        else
          console.dir(result.data());
      }
    );

Using such a query, you can get the fields and their properties, including the "isreadonly" property (read-only): if its value is true, then this field cannot be edited, if false, then you can. How can this property be changed using the REST API ?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Shumakov, 2019-08-05
@ivanshumakov

You need to use the crm.lead.userfield.update method to set the EDIT_IN_LIST property to N (disabled) or Y (active). Example (js):

BX24.callMethod(
        `crm.${fieldsSet}.userfield.update`,
        {
            id: id,
            fields:
                {
                    'EDIT_IN_LIST': makeEditable
                }
        },
        function(result)
        {
            if(result.error()){
                console.error("ERROR: " + result.error());
            }
            else
            {
                console.dir(result.data());
            }
        }
    );

*fieldsSet variable can take values ​​lead, company, etc.

K
kulgan, 2019-06-26
@kulgan

In any way) this is the meaning of the field, that you cannot change it in any way. Most likely, the field has a complex recording logic, and if you just change only it, then everything can break down, so they don’t let you change it directly, and in order to change it, you need to understand how it is formed / recorded and at this stage something to do with it. What field do you want to change?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question